/* Popup Styles */
#tcn-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#tcn-popup-container {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 400px;
    text-align: center;
    position: relative;
    font-family: Arial, sans-serif;
}

#tcn-close-popup {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #888;
}

#tcn-popup-container h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 24px;
}

#tcn-popup-container p {
    margin-bottom: 20px;
    color: #666;
    font-size: 16px;
}

.tcn-form-field {
    margin-bottom: 20px;
    text-align: left;
}

.tcn-form-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

.tcn-form-field input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 16px;
}

#tcn-submit-button {
    background-color: #0073e6;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    font-size: 18px;
    transition: background-color 0.3s ease;
}

#tcn-submit-button:hover {
    background-color: #005bb5;
}

#tcn-submit-button:disabled {
    background-color: #a0a0a0;
    cursor: not-allowed;
}

#tcn-feedback {
    margin-top: 20px;
    padding: 12px;
    border-radius: 5px;
    font-size: 16px;
}

#tcn-feedback.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

#tcn-feedback.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.tcn-privacy {
    font-size: 12px;
    color: #999;
    margin-top: 20px;
}

/* Re-open Link */
#tcn-reopen-popup {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #0073e6;
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    text-decoration: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 999;
}

/* Feed Layout Styles (Masonry Format using Masonry JS) */
.tcn-feed-container {
    display: block;
    width: 100%;
    max-width: 1200px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    box-sizing: border-box;
}

.tcn-feed-card {
    float: left; /* Fallback for grid float alignment before Masonry loads */
    width: 100%;
    background-color: #ffffff;
    border: 1px solid #e1e8ed;
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    break-inside: avoid; /* Prevents card from splitting across columns */
}

.tcn-feed-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.tcn-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    border-bottom: 1px solid #f5f8fa;
    padding-bottom: 8px;
}

.tcn-card-title {
    font-weight: 700;
    font-size: 16px;
    color: #14171a;
}

.tcn-card-time {
    font-size: 12px;
    color: #657786;
}

.tcn-card-body {
    display: flex;
    flex-direction: column;
}

.tcn-card-text {
    font-size: 15px;
    line-height: 1.5;
    color: #14171a;
    margin: 0 0 12px 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.tcn-card-text a {
    color: #0073e6;
    text-decoration: none;
}

.tcn-card-text a:hover {
    text-decoration: underline;
}

.tcn-card-mms {
    margin-top: 10px;
    border-radius: 8px;
    overflow: hidden;
    max-height: 400px;
    display: flex;
    justify-content: center;
    background-color: #f5f8fa;
    border: 1px solid #e1e8ed;
}

.tcn-card-mms img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.tcn-card-previews {
    margin-top: 12px;
}

.tcn-preview-link {
    text-decoration: none;
    display: block;
}

.tcn-preview-card {
    display: flex;
    flex-direction: column; /* Changed to column layout to fit beautifully inside narrow masonry cards */
    border: 1px solid #e1e8ed;
    border-radius: 10px;
    overflow: hidden;
    background-color: #f5f8fa;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.tcn-preview-link:hover .tcn-preview-card {
    background-color: #eef2f5;
    border-color: #cbd5e0;
}

.tcn-preview-image {
    width: 100%;
    height: 150px; /* Fixed height for image area */
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #e1e8ed; /* Bottom border separator */
    background-color: #eef2f5;
}

.tcn-preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tcn-preview-info {
    padding: 12px 15px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-width: 0;
}

.tcn-preview-title {
    font-weight: 700;
    font-size: 14px;
    color: #14171a;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tcn-preview-desc {
    font-size: 13px;
    color: #657786;
    margin: 0 0 5px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tcn-preview-domain {
    font-size: 11px;
    color: #657786;
    text-transform: lowercase;
    font-weight: 500;
}

/* Feed empty/error states */
.tcn-feed-empty, .tcn-feed-error {
    text-align: center;
    padding: 20px;
    color: #657786;
    background-color: #f5f8fa;
    border: 1px dashed #cbd5e0;
    border-radius: 8px;
    font-family: inherit;
    max-width: 600px;
    margin: 20px auto;
}

