/**
 * Main Feed Styles - Distinct from Events
 */

/* === MAIN FEED CONTAINER === */
.feed-container {
    width: 100%;
}

/* === MAIN POST INPUT FORM === */
.main-post-input {
    background: linear-gradient(135deg, #1a2a3a 0%, #0d1a26 100%);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.main-post-input h4 {
    margin: 0 0 12px 0;
    color: #A8D8FA;
    font-size: 1.1em;
}

/* === MAIN DESCRIPTION TEXTAREA === */
.main-inputbx {
    width: 100%;
    height: 80px;
    margin: 3px auto 1px auto;
    padding: 10px 12px;
    background-color: #ffffff;
    border-radius: 6px;
    font-weight: 500;
    font-size: 1em;
    color: #000000;
    text-align: left;
    border: 1px solid #ccc;
    resize: vertical;
    font-family: inherit;
}

.main-inputbx::placeholder {
    color: #888;
}

.main-counter {
    color: #A8D8FA;
    font-size: 0.9em;
    margin-top: 4px;
    margin-bottom: 8px;
    font-weight: 600;
}

/* === MAIN DRAG & DROP ZONE === */
.main-drag-container {
    width: 100%;
    margin: 12px 0;
}

.main-drag-container [data-secure-media-uploader] {
    display: block;
    width: 100%;
}

/*
 * Secure uploader markup uses: <div data-secure-drop-zone class="drop-zone">.
 * The old CSS only targeted #main-drop-zone, so the styled/clickable-looking
 * area could shrink to the text instead of filling the feed form width.
 */
#main-drop-zone,
.main-drag-container [data-secure-drop-zone],
.main-drag-container .drop-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 132px;
    box-sizing: border-box;
    border: 2px dashed #4a6a8a;
    border-radius: 10px;
    padding: 24px;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    background: rgba(255, 255, 255, 0.03);
    color: #7a9ab8;
    text-align: center;
}

#main-drop-zone.highlight,
#main-drop-zone:hover,
.main-drag-container [data-secure-drop-zone].highlight,
.main-drag-container [data-secure-drop-zone].dragover,
.main-drag-container [data-secure-drop-zone].is-dragover,
.main-drag-container [data-secure-drop-zone]:hover,
.main-drag-container .drop-zone.highlight,
.main-drag-container .drop-zone:hover {
    border-color: #3498db;
    background-color: rgba(52, 152, 219, 0.1);
    box-shadow: inset 0 0 0 1px rgba(52, 152, 219, 0.18);
}

.main-drop-zone-text,
.main-drag-container [data-secure-drop-zone] p,
.main-drag-container [data-secure-drop-zone] small {
    pointer-events: none;
}

.main-drop-zone-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #7a9ab8;
    text-align: center;
}

.main-drop-zone-text .icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.main-drop-zone-text p,
.main-drag-container [data-secure-drop-zone] p {
    margin: 0 0 6px;
    font-size: 0.95em;
    font-weight: 700;
}

.main-drag-container [data-secure-drop-zone] small {
    display: block;
    max-width: 620px;
    color: #8eaac4;
    font-size: 0.82em;
    line-height: 1.35;
}

#main-upload-previews,
#secure-main-upload-previews,
.main-drag-container [data-secure-upload-previews] {
    width: 100%;
    margin-top: 12px;
}

.main-preview-item {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 8px;
}

.main-preview-item.success {
    border-left: 4px solid #28a745;
}

.main-preview-item.error {
    border-left: 4px solid #dc3545;
}

.main-preview-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.main-preview-name {
    font-size: 0.85em;
    color: var(--fg);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 70%;
}

.main-preview-type {
    font-size: 0.75em;
    color: #A8D8FA;
    text-transform: uppercase;
    background: rgba(168, 216, 250, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.main-progress-bar-container {
    position: relative;
    background: #2a3a4a;
    border-radius: 4px;
    height: 18px;
    overflow: hidden;
}

.main-progress-bar {
    background: linear-gradient(90deg, #22b07d, #28d490);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-progress-text {
    color: white;
    font-weight: bold;
    font-size: 0.75em;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.main-upload-status {
    color: #7a9ab8;
    font-size: 0.8em;
    margin-top: 4px;
}

/* === MAIN VIDEO LINK SELECTOR === */
.main-video-link-group {
    position: relative;
    width: 100%;
    z-index: 50;
    margin-top: 12px;
}

.main-video-link-selector {
    background: var(--surface-2);
    color: var(--fg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 0.95em;
    width: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.main-video-link-selector:hover {
    background: #2d3343;
}

.main-video-link-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    z-index: 150;
    display: none;
}

.main-video-link-dropdown.active {
    display: block;
}

.main-video-link-option {
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    color: var(--fg);
}

.main-video-link-option:hover {
    background: #2d3343;
}

.main-video-link-option.selected {
    background: var(--accent);
    color: white;
}

.main-video-input-container {
    margin-top: 8px;
    display: none;
}

.main-video-input-container.active {
    display: block;
}

.main-video-input-container input {
    width: 100%;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95em;
    color: #333;
}

.main-video-input-container small {
    color: #7a9ab8;
    display: block;
    margin-top: 4px;
    font-size: 0.8em;
}

/* === MAIN POST SUBMIT BUTTON === */
.main-form-actions {
    margin-top: 12px;
    display: flex;
    gap: 10px;
}

.btn-main-post {
    flex: 1;
    background: linear-gradient(90deg, #22b07d, #1a8a62);
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-main-post:hover {
    background: linear-gradient(90deg, #28c88f, #22a070);
    transform: translateY(-1px);
}

.btn-main-post:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* === MAIN POST CARDS === */
.main-post-card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    overflow: hidden;
}

/* === POST TOP BANNER === */
.main-post-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: linear-gradient(90deg, rgba(39, 132, 255, 0.15), rgba(34, 176, 125, 0.1));
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.main-post-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.main-category-icon {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    /*background: var(--surface-2);*/
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.main-category-icon a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.main-category-icon img {
    width: 60px;
    height: 60px;
}

.main-author-portrait {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    /*border:0px solid var(--border);*/
    object-fit: cover;
}

.main-author-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.main-author-name {
    font-weight: 600;
    font-size: 0.95em;
    color: var(--fg);
}

.main-author-location {
    font-size: 0.8em;
    color: var(--muted);
}

.main-post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.datetime {margin: 3px 0px 0px 6px;}

.main-post-date {
    font-size: 0.8em;
    line-height: 1.2em;
    color: var(--muted);
}

.btn-main-share {
    background: transparent;
    border: 1px solid var(--border);
    color: #A8D8FA;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.btn-main-share:hover {
    background: rgba(168, 216, 250, 0.1);
    border-color: #A8D8FA;
}

.btn-main-share svg {
    width: 14px;
    height: 14px;
}

/* === POST CONTENT === */
.main-post-content {
    padding: 14px;
}

.main-post-description {
    margin: 0 0 12px 0;
    font-size: 1em;
    line-height: 1.5;
    color: var(--fg);
}

.main-post-media {
    margin-top: 12px;
}

.main-post-media img {
    width: 100%;
    border-radius: 8px;
    object-fit: cover;
    max-height: 400px;
}

.main-post-media audio {
    width: 100%;
    margin-top: 8px;
}

.main-post-media video {
    width: 100%;
    border-radius: 8px;
    max-height: 400px;
}

.main-post-media.embed iframe {
    width: 100%;
    height: 280px;
    border-radius: 8px;
    border: 2px solid rgba(168, 216, 250, 0.3);
}

/* === POST BOTTOM BANNER === */
.main-post-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-main-report {
    background: transparent;
    border: 1px solid rgba(231, 76, 60, 0.4);
    color: #e74c3c;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.8em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.btn-main-report:hover {
    background: rgba(231, 76, 60, 0.1);
    border-color: #e74c3c;
}

.btn-main-report svg {
    width: 12px;
    height: 12px;
}

/* === MAIN RATING (DISTINCT FROM EVENTS) === */
.main-rating-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.main-rating-dots {
    display: flex;
    gap: 4px;
}

.main-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3a4a5a;
    display: inline-block;
    transition: background 0.2s;
}

.main-dot.filled {
    background: linear-gradient(90deg, #22b07d, #28d490);
}

.main-rating-info {
    font-size: 0.8em;
    color: var(--muted);
}

.main-rating-info small {
    margin-right: 6px;
}

.main-rate-action {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-main-rate {
    background: transparent;
    border: 1px solid #22b07d;
    color: #22b07d;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.8em;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-main-rate:hover {
    background: rgba(34, 176, 125, 0.1);
}

.main-rate-slider {
    display: none;
    align-items: center;
    gap: 8px;
}

.main-rate-slider input[type="range"] {
    width: 100px;
    accent-color: #22b07d;
}

.btn-submit-main-rate {
    /*background: #22b07d;*/
    background:linear-gradient(90deg, #21f5fc, #216efc);
    color: #fff;
    border: none;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.8em;
    cursor: pointer;
}

.btn-submit-main-rate:hover {
    background: #1a8a62;
}

/* === REPLY TO POST BUTTON === */
/* FIX #1: Comment icon - transparent background, 20% width, on right side with counter on left */
.btn-main-reply-toggle {
    background: transparent;
    border: 0;
    color: #A8D8FA;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.95em;
    cursor: pointer;
    display: flex;
    flex-direction: row;         /* horizontal layout */
    align-items: center;
    justify-content: flex-end;   /* push content to the right */
    gap: 8px;
    transition: all 0.2s;
    width: 100%;
    margin: 10px 14px;
}

.btn-main-reply-toggle:hover {
    background: rgba(168, 216, 250, 0.1);
    border-color: #A8D8FA;
}

/* Counter on the left side */
.main-reply-count {
    font-size: 0.95em;
    line-height: 1;
    opacity: 0.9;
    order: 1;  /* counter comes first (left) */
}

/* Comment icon - 20% width, transparent background, on the right */
.main-reply-icon {
    width: 20%;
    max-width: 40px;
    height: auto;
    display: inline-block;
    object-fit: contain;
    background: transparent !important;  /* remove white box */
    border: none;
    order: 2;  /* icon comes second (right) */
}

/* === REPLIES SECTION === */
.main-replies-section {
    padding: 14px;
    background: rgba(0, 0, 0, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* === REPLY INPUT === */
/* FIX #2: Portrait left of textarea */
.main-reply-input-wrap {
    display: flex;
    flex-direction: row;
    gap: 12px;
    margin-bottom: 16px;
    align-items: flex-start;
}

/* Portrait on the left */
.main-reply-user-portrait {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    order: 1;  /* portrait first (left) */
}

/* Input container takes remaining space */
.main-reply-input-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    order: 2;  /* input container second (right of portrait) */
}

/* Reply textarea */
.main-reply-textarea {
    width: 100%;
    height: 80px;
    margin: 0;
    padding: 10px 12px;
    background-color: #ffffff;
    border-radius: 6px;
    font-weight: 500;
    font-size: 1em;
    color: #000000;
    text-align: left;
    border: 1px solid #ccc;
    resize: vertical;
    font-family: inherit;
}

.main-reply-textarea::placeholder {
    color: #888;
}

/* FIX #3: Footer with counter on top, button full width below */
.main-reply-input-footer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin-top: 8px;
    gap: 8px;
}

/* Character counter */
.main-reply-char-count {
    font-size: 0.9em;
    color: #A8D8FA;
    font-weight: 600;
    text-align: left;
}

/* Submit button - full width under counter */
.btn-main-submit-reply {
    width: 100%;
    background: linear-gradient(90deg, #22b07d, #1a8a62);
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-main-submit-reply:hover {
    background: linear-gradient(90deg, #28c88f, #22a070);
    transform: translateY(-1px);
}

.btn-main-submit-reply:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* === LOGIN PROMPT === */
.main-reply-login-prompt {
    text-align: center;
    padding: 12px;
    color: var(--muted);
    font-size: 0.9em;
}

.main-reply-login-prompt a {
    color: #A8D8FA;
    text-decoration: underline;
}

/* === REPLIES LIST === */
.main-replies-list {
    max-height: 400px;
    overflow-y: auto;
}

.main-no-replies {
    text-align: center;
    color: var(--muted);
    font-size: 0.9em;
    padding: 16px;
}

/* === INDIVIDUAL REPLY ITEM === */
.main-reply-item {
    display: flex;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.main-reply-item:last-child {
    border-bottom: none;
}

.main-reply-portrait {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.main-reply-content {
    flex: 1;
    min-width: 0;
}

.main-reply-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.main-reply-author {
    font-weight: 600;
    font-size: 0.9em;
    color: var(--fg);
}

.main-reply-date {
    font-size: 0.75em;
    color: var(--muted);
}

.main-reply-text {
    width: 100%;
    margin: 0;
    font-size: 0.9em;
    line-height: 1.4;
    color: var(--fg);
    word-wrap: break-word;
}

/* === REPLY ACTIONS === */
.main-reply-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.btn-main-reply-like,
.btn-main-reply-dislike,
.btn-main-reply-to-reply {
    background: transparent;
    border: none;
    color: var(--muted);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.btn-main-reply-like:hover {
    color: #22b07d;
    background: rgba(34, 176, 125, 0.1);
}

.btn-main-reply-like.active {
    color: #22b07d;
}

.btn-main-reply-dislike:hover {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

.btn-main-reply-dislike.active {
    color: #e74c3c;
}

.btn-main-reply-to-reply:hover {
    color: #A8D8FA;
    background: rgba(168, 216, 250, 0.1);
}

.btn-main-reply-like svg,
.btn-main-reply-dislike svg,
.btn-main-reply-to-reply svg {
    width: 14px;
    height: 14px;
}

.main-like-count,
.main-dislike-count {
    font-size: 0.9em;
}

/* === MAIN NOTIFICATIONS === */
.main-notification-info {
    background: #2784ff;
    color: #fff;
}

.main-notification.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* === EMPTY STATE === */
.main-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
}

.main-empty-state .icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* === RESPONSIVE === */
@media (max-width: 720px) {
    .main-post-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .main-post-meta {
        width: 100%;
        justify-content: space-between;
    }

    .main-post-footer {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .main-rating-wrap {
        flex-wrap: wrap;
    }

    .main-post-media.embed iframe {
        height: 200px;
    }

    .main-reply-actions {
        flex-wrap: wrap;
        gap: 8px;
    }

    .main-replies-list {
        max-height: 300px;
    }

    /* Adjust portrait size on smaller screens */
    .main-reply-user-portrait {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }
}

/* ADDED FROM BASE_FEED_SECTION */

/* =====================================================
   MAIN FEED DROP ZONE WIDTH FIX
   Scoped to main feed only; does not affect Albums.
   ===================================================== */

.main-post-input #main-post-form,
.main-post-input .main-drag-container,
.main-post-input .main-drag-container [data-secure-media-uploader] {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box !important;
}

.main-post-input #main-drop-zone,
.main-post-input .main-drop-zone,
.main-post-input .main-drag-container > [data-secure-media-uploader] > [data-secure-drop-zone] {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;

    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    min-height: 132px !important;
    box-sizing: border-box !important;

    border: 2px dashed #4a6a8a !important;
    border-radius: 10px !important;
    padding: 24px !important;

    background: rgba(255, 255, 255, 0.03) !important;
    color: #7a9ab8 !important;
    text-align: center !important;
    cursor: pointer !important;
}

.main-post-input #main-drop-zone:hover,
.main-post-input #main-drop-zone.highlight,
.main-post-input #main-drop-zone.dragover,
.main-post-input #main-drop-zone.is-dragover {
    border-color: #3498db !important;
    background-color: rgba(52, 152, 219, 0.1) !important;
    box-shadow: inset 0 0 0 1px rgba(52, 152, 219, 0.18) !important;
}

.main-post-input #main-drop-zone p,
.main-post-input #main-drop-zone small {
    display: block !important;
    width: 100% !important;
    max-width: 620px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    pointer-events: none !important;
    box-sizing: border-box !important;
}

.main-post-input #main-drop-zone p {
    margin-top: 0 !important;
    margin-bottom: 6px !important;
    font-size: 0.95em !important;
    font-weight: 700 !important;
}

.main-post-input #main-drop-zone small {
    color: #8eaac4 !important;
    font-size: 0.82em !important;
    line-height: 1.35 !important;
}

/* Make sure the native file input is not creating a tiny visible/clickable box. */
.main-post-input .main-drag-container input[data-secure-file-input] {
    display: none !important;
}
