/**
 * Modern Modal System
 * Instagram/Twitter-inspired sleek modal design
 */

/* Modal Overlay */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow: hidden; /* Prevent background scroll */
}

.modal.show {
    display: flex;
    opacity: 1;
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
    /* Removed position: fixed to allow proper fixed positioning of child elements */
    /* Height will be set via JavaScript to prevent iOS Safari viewport resize issues */
}

/* Dark overlay background */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
    pointer-events: none; /* Allow clicks to pass through to content */
}

/* Modal Container - Fixed height to prevent iOS Safari resize */
.modal-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    /* Use large viewport height (doesn't change with Safari toolbar) with fallback */
    height: 100vh; /* Fallback for older browsers */
    height: 100lvh; /* Large viewport height - doesn't resize with iOS Safari toolbar */
    display: flex;
    align-items: stretch;
    justify-content: center;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* Modal Content Wrapper - Natural height, scrollable */
.modal-content-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
    margin: 0;
    padding: 0;
}

/* Desktop: Two-column layout with reasonable max-width */
@media (min-width: 1024px) {
    .modal-content-wrapper {
        max-width: 1600px;
        margin: 0 auto;
    }

    .modal-two-column {
        flex-direction: row;
    }

    .modal-media-section {
        flex: 1;
        min-width: 0;
        max-height: none;
        height: auto;
    }

    .modal-info-section {
        flex: 0 0 450px;
        width: 450px;
        max-height: 100vh;
        overflow-y: auto;
    }
}

/* Extra large screens: Increase content width */
@media (min-width: 1440px) {
    .modal-content-wrapper {
        max-width: 1800px;
    }

    .modal-info-section {
        flex: 0 0 500px;
        width: 500px;
    }
}

/* Modal Header - Fixed at top */
.modal-header-bar {
    flex-shrink: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 10;
    backdrop-filter: blur(10px);
    background: rgba(var(--bg-primary-rgb), 0.95);
}

.modal-header-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Header Badges - Desktop Only */
.modal-header-badges {
    display: none;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* Header Stats - Desktop Only */
.modal-header-stats {
    display: none;
    gap: 20px;
    align-items: center;
}

.modal-stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.modal-stat-item i {
    font-size: 0.85rem;
}

/* Header Action Buttons - Desktop Only */
.modal-header-actions {
    display: none;
    gap: 8px;
    align-items: center;
}

.modal-header-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-header-btn:hover {
    background: rgba(168, 85, 247, 0.1);
    border-color: #a855f7;
    color: #a855f7;
    transform: translateY(-2px);
}

.modal-header-btn:active {
    transform: translateY(0);
}

.modal-header-btn.liked {
    color: #ef4444;
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.modal-header-btn.liked:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Delete Button Styling */
.modal-delete-btn {
    color: #ef4444 !important;
    border-color: #ef4444 !important;
}

.modal-delete-btn:hover {
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: #ef4444 !important;
    color: #ef4444 !important;
    transform: translateY(-2px);
}

/* Badge Styling */
.modal-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.modal-badge i {
    font-size: 0.8rem;
}

.game-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.game-badge:hover {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transform: translateY(-1px);
}

.category-badge {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(245, 87, 108, 0.3);
}

.category-badge:hover {
    box-shadow: 0 4px 12px rgba(245, 87, 108, 0.4);
    transform: translateY(-1px);
}

.modal-badges-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

/* Desktop: Show header stats and actions, hide mobile sections */
@media (min-width: 769px) {
    .modal-header-badges {
        display: flex;
    }

    .modal-header-stats {
        display: flex;
    }

    .modal-header-actions {
        display: flex;
    }

    .mobile-only {
        display: none !important;
    }
}

/* Mobile: Hide header stats and actions, show mobile sections */
@media (max-width: 768px) {
    .modal-header-stats,
    .modal-header-actions {
        display: none;
    }

    .modal-header-title {
        font-size: 0.95rem;
    }

    .modal-header-bar {
        padding: 12px 16px;
    }

    /* Hide regular comments section on mobile - replaced with bottom sheet */
    .modal-comments-section {
        display: none;
    }

    /* Compact image on mobile */
    .modal-media-section {
        max-height: 45vh;
        min-height: 250px;
    }

    /* Compact user header */
    .modal-user-header {
        padding: 12px 16px;
    }

    .modal-user-avatar {
        width: 32px;
        height: 32px;
    }

    .modal-username {
        font-size: 0.9rem;
    }

    .modal-timestamp {
        font-size: 0.8rem;
    }

    /* Compact content details */
    .modal-content-details {
        padding: 12px 16px;
    }

    .modal-description {
        font-size: 0.9rem;
        line-height: 1.5;
        margin-bottom: 12px;
    }

    .modal-badges-row {
        margin-bottom: 12px;
    }

    .modal-badge {
        font-size: 0.8rem;
        padding: 4px 10px;
    }

    /* Compact stats */
    .modal-meta-row {
        font-size: 0.85rem;
        gap: 12px;
        margin-bottom: 12px;
    }

    /* Compact action buttons */
    .modal-actions-bar {
        padding: 12px 16px;
        gap: 8px;
    }

    .modal-action-btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    /* Compact action row - combines stats and actions */
    /* Now positioned directly below image on mobile */
    .modal-compact-actions {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 12px 16px;
        border-top: 1px solid var(--border-color);
        background: var(--bg-primary);
        position: relative;
        z-index: 1;
    }

    .modal-compact-btn {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 10px;
        background: transparent;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        color: var(--text-secondary);
        font-size: 0.9rem;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s ease;
        /* Fix iOS Safari touch event issues */
        -webkit-tap-highlight-color: rgba(168, 85, 247, 0.2);
        touch-action: manipulation;
        user-select: none;
        -webkit-user-select: none;
    }

    .modal-compact-btn:active {
        transform: scale(0.95);
        background: var(--bg-secondary);
    }

    .modal-compact-btn.active {
        color: #ef4444;
        border-color: #ef4444;
        background: rgba(239, 68, 68, 0.1);
    }

    .modal-compact-btn i {
        font-size: 1rem;
    }

    .modal-compact-stat {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 10px;
        color: var(--text-secondary);
        font-size: 0.9rem;
    }
}

/* Mobile Comment Bottom Sheet (YouTube-style) */
.modal-comment-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #0f172a;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10002;
    max-height: 85vh;
    display: none;
}

.modal-comment-sheet.open {
    transform: translateY(0);
}

/* Show on mobile only */
@media (max-width: 768px) {
    .modal-comment-sheet {
        display: flex;
        flex-direction: column;
    }
}

/* Drag Handle */
.modal-comment-sheet-handle {
    width: 100%;
    padding: 12px 0 8px;
    display: flex;
    justify-content: center;
    cursor: grab;
    touch-action: none;
}

.modal-comment-sheet-handle:active {
    cursor: grabbing;
}

.modal-comment-sheet-handle-bar {
    width: 40px;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
}

/* Sheet Header */
.modal-comment-sheet-header {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.modal-comment-sheet-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.modal-comment-sheet-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-comment-sheet-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Sheet Content */
.modal-comment-sheet-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
}

/* Comment Button - Mobile Only - Fixed at Bottom */
.mobile-comment-trigger {
    display: none;
}

@media (max-width: 768px) {
    .mobile-comment-trigger {
        position: fixed;
        bottom: calc(20px + env(safe-area-inset-bottom));
        left: 20px;
        right: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 16px 20px;
        background: #1e293b;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 50px;
        color: #ffffff;
        font-size: 0.95rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s ease;
        z-index: 10005;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
        /* Fix iOS Safari touch event issues */
        -webkit-tap-highlight-color: rgba(168, 85, 247, 0.2);
        touch-action: manipulation;
        user-select: none;
        -webkit-user-select: none;
    }

    .mobile-comment-trigger:active {
        transform: scale(0.96);
    }

    .mobile-comment-trigger i {
        font-size: 1.1rem;
        color: #a855f7;
    }

    /* Ensure modal is scrollable on mobile */
    .modal-container {
        overflow-y: auto;
    }

    /* Add padding at bottom of modal content so fixed button doesn't cover content */
    /* Button height (~56px) + bottom spacing (20px) + extra clearance (100px) = 176px */
    .modal-info-section {
        padding-bottom: calc(180px + env(safe-area-inset-bottom));
    }
}

/* Bottom Sheet Backdrop */
.modal-comment-sheet-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-comment-sheet-backdrop.show {
    opacity: 1;
    visibility: visible;
}

/* Close Button - Top Right */
.modal-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-left: 12px;
}

.modal-close-btn:hover {
    background: var(--bg-light);
    transform: scale(1.1);
}

/* Modal Body - Content Container */
.modal-body-scroll {
    width: 100%;
    flex: 1;
    box-sizing: border-box;
}

/* Custom scrollbar for modal */
.modal-container::-webkit-scrollbar {
    width: 8px;
}

.modal-container::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.modal-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.modal-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Single Column Layout - Desktop & Mobile */
/* Image on top (large), content below (scrollable) */
.modal-two-column {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.modal-media-section {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    width: 100%;
    flex-shrink: 0;
}

.modal-media-section img,
.modal-media-section video {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.modal-info-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    flex: 1;
    box-sizing: border-box;
}

/* User Info Header in Info Section */
.modal-user-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0; /* Don't shrink when content scrolls */
}

.modal-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
}

.modal-user-avatar img,
.modal-user-avatar i {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.modal-user-details {
    flex: 1;
}

.modal-username {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    cursor: pointer;
}

.modal-username:hover {
    text-decoration: underline;
}

.modal-timestamp {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Content Details */
.modal-content-details {
    width: 100%;
    padding: 20px;
    flex: 1;
    overflow-y: auto;
    box-sizing: border-box;
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: var(--text-primary);
}

.modal-description {
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.description-text {
    transition: max-height 0.3s ease;
}

.description-text.truncated {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.description-toggle {
    background: none;
    border: none;
    color: #a855f7;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
    margin-top: 4px;
    transition: color 0.2s ease;
}

.description-toggle:hover {
    color: #d946ef;
}

.modal-meta-row {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.modal-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.modal-meta-item i {
    font-size: 0.9rem;
}

/* Action Buttons Section */
.modal-actions-bar {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.modal-action-btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #a855f7, #d946ef);
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.modal-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

.modal-action-btn.secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-action-btn.secondary:hover {
    background: var(--bg-light);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Comments Section */
.modal-comments-section {
    width: 100%;
    padding: 20px;
    border-top: 1px solid var(--border-color);
    box-sizing: border-box;
}

.modal-comments-header {
    width: 100%;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.modal-comment-form {
    width: 100%;
    margin-bottom: 20px;
    box-sizing: border-box;
}

.modal-comment-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.95rem;
    resize: vertical;
    min-height: 80px;
    margin-bottom: 10px;
    font-family: inherit;
}

.modal-comment-input:focus {
    outline: none;
    border-color: #a855f7;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

.modal-comment {
    width: 100%;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 12px;
    box-sizing: border-box;
}

.modal-comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.modal-comment-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
}

.modal-comment-avatar img,
.modal-comment-avatar i {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    font-size: 1rem;
    color: var(--text-secondary);
}

.modal-comment-username {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.modal-comment-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.modal-comment-text {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.5;
}

/* Admin Actions - Modern Three-Dot Menu */
.modal-admin-menu {
    position: relative;
}

.modal-admin-toggle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.modal-admin-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.modal-admin-toggle:active {
    transform: scale(0.95);
}

.modal-admin-toggle i {
    font-size: 1.1rem;
}

/* Dropdown Menu */
.modal-admin-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3),
                0 2px 8px rgba(0, 0, 0, 0.2);
    min-width: 200px;
    display: none;
    z-index: 10001;
    overflow: hidden;
    backdrop-filter: blur(10px);
    background: rgba(var(--bg-primary-rgb, 15, 23, 42), 0.95);
}

.modal-admin-dropdown.show {
    display: block;
    animation: dropdownSlideIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes dropdownSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Dropdown Options */
.modal-admin-option {
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    transition: all 0.15s ease;
    border-bottom: 1px solid transparent;
}

.modal-admin-option:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-admin-option i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    opacity: 0.9;
}

.modal-admin-option:hover {
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
}

.modal-admin-option:hover i {
    opacity: 1;
}

.modal-admin-option.danger {
    color: #ef4444;
}

.modal-admin-option.danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.modal-admin-option.danger i {
    color: #ef4444;
}

/* Backdrop for dropdown */
.modal-admin-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    display: none;
}

.modal-admin-backdrop.show {
    display: block;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Small mobile devices - Further optimization */
@media (max-width: 640px) {
    .modal-media-section {
        max-height: 40vh;
        min-height: 220px;
    }

    .modal-header-bar {
        padding: 10px 14px;
    }

    .modal-header-title {
        font-size: 0.9rem;
    }

    .modal-user-header {
        padding: 10px 14px;
    }

    .modal-content-details {
        padding: 10px 14px;
    }

    .modal-actions-bar {
        padding: 10px 14px;
        gap: 6px;
    }

    .modal-action-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
    }

    .modal-compact-actions {
        padding: 10px 14px;
        gap: 6px;
    }

    .modal-compact-btn {
        padding: 8px;
        font-size: 0.85rem;
    }

    .modal-description {
        font-size: 0.85rem;
        margin-bottom: 10px;
    }

    .modal-meta-row {
        font-size: 0.8rem;
        gap: 10px;
        margin-bottom: 10px;
    }

    .modal-info-section {
        padding-bottom: calc(170px + env(safe-area-inset-bottom));
    }
}

/* Very small screens - Maximum compaction */
@media (max-width: 480px) {
    .modal-media-section {
        max-height: 35vh;
        min-height: 200px;
    }

    .modal-header-bar,
    .modal-user-header,
    .modal-content-details,
    .modal-actions-bar {
        padding: 8px 12px;
    }

    .modal-description {
        font-size: 0.8rem;
        line-height: 1.4;
    }

    .modal-action-btn {
        padding: 8px 12px;
        font-size: 0.75rem;
    }

    .modal-compact-actions {
        padding: 8px 12px;
        gap: 6px;
    }

    .modal-compact-btn {
        padding: 8px 6px;
        font-size: 0.8rem;
        gap: 4px;
    }

    .mobile-comment-trigger {
        padding: 12px 16px;
        font-size: 0.9rem;
        bottom: calc(16px + env(safe-area-inset-bottom));
        left: 16px;
        right: 16px;
    }

    .modal-info-section {
        padding-bottom: calc(160px + env(safe-area-inset-bottom));
    }
}

/* Loading State */
.modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: var(--text-secondary);
    font-size: 2rem;
}

.modal-loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Empty State */
.modal-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.modal-empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.modal-empty-state p {
    font-size: 0.95rem;
}
