/* Soul Scrolls Modal - Clean Nexus Design System
 *
 * v3.7 - ULTRA-COMPACT AVATAR BOX OPTIMIZATION (2025-10-18) 🔥
 * - MASSIVE avatar box space savings: 33% gap reduction, 31% padding reduction, 20% min-width reduction
 * - Removed wasteful legacy CSS overrides from blog.css (gap: 1.5rem → 0.5rem, padding: 1.5rem 2rem → 0.4rem 0.6rem)
 * - Tightened responsive breakpoints: tablet 110px, mobile 90px min-width
 * - Optimized avatar size: 'md' → 'sm' in blog-modal.js for maximum compactness
 * - Added subtle depth enhancements: inset highlights, refined hover micro-feedback
 * - Sharper border-radius (12px → 8px desktop, 6px mobile) for modern aesthetic
 * - Thinner borders on mobile (2px → 1.5px) to save horizontal space
 * - flex-shrink: 1 allows graceful degradation in tight spaces
 * - max-width: 100% prevents overflow on ultra-narrow viewports
 * - Smooth cubic-bezier transitions for polished micro-interactions
 * WCAG 2.1 AA Compliance: All touch targets remain 44x44px minimum ✓
 */

/* ===== MODAL FOUNDATION ===== */
#blogModal.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    padding: 1rem;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ===== MODAL CONTENT CONTAINER ===== */
.scrolls-modal-content {
    background: linear-gradient(135deg,
        rgba(26, 26, 51, 0.98),
        rgba(42, 64, 102, 0.95)
    );
    border: 2px solid rgba(255, 94, 120, 0.4);
    border-radius: 20px;
    padding: 0;
    max-width: min(900px, 95vw);
    max-height: min(85vh, 900px);
    width: 100%;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.8),
        0 15px 35px rgba(255, 94, 120, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    /* REMOVED transform - it breaks position:fixed for dropdown */
    /* transform: scale(0.9) translateY(20px); */
    opacity: 0.8; /* Use opacity for entry animation instead */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    /* Mystical border glow */
    &::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: inherit;
        padding: 2px;
        background: linear-gradient(45deg,
            rgba(255, 94, 120, 0.8),
            rgba(255, 202, 40, 0.6),
            rgba(255, 94, 120, 0.8)
        );
        mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
        mask-composite: exclude;
        opacity: 0.7;
        animation: modalGlow 3s ease-in-out infinite alternate;
        pointer-events: none;
    }
}

#blogModal.modal.show .scrolls-modal-content {
    /* REMOVED transform - it breaks position:fixed for dropdown */
    /* transform: scale(1) translateY(0); */
    opacity: 1; /* Fade in to full opacity */
}

@keyframes modalGlow {
    0% { opacity: 0.4; }
    100% { opacity: 0.8; }
}

/* ===== UNIFIED MODAL HEADER BAR ===== */
.modal-header-bar {
    display: grid !important;
    grid-template-columns: minmax(130px, auto) 1fr minmax(44px, auto) !important;
    align-items: center !important;
    gap: 1.25rem !important; /* Increased for better breathing room */
    padding: 0.875rem 1.25rem !important; /* Increased from 0.65rem 1rem - more generous spacing */
    border-bottom: 1px solid rgba(255, 94, 120, 0.2) !important;
    background: linear-gradient(135deg,
        rgba(26, 26, 51, 0.8),
        rgba(42, 64, 102, 0.6)
    ) !important;
    position: relative !important; /* Force non-sticky - avatar scrolls away */
    overflow: visible; /* Allow author card content to display fully */
    margin: 0 !important; /* Remove any margin */
}

.modal-header-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    grid-column: 3;
}

.modal-vote-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent; /* Reduced visual weight - was rgba(26, 26, 51, 0.6) */
    border: 1px solid rgba(255, 94, 120, 0.15); /* More subtle - was 0.25 */
    border-radius: 22px;
    padding: 0.3rem 0.6rem; /* Slightly more generous */
    backdrop-filter: none; /* Removed blur to reduce prominence */
    grid-column: 1;
    overflow: visible; /* Allow dropdown to extend beyond container */
    position: relative; /* For dropdown positioning */
}

.compact-vote-btn {
    background: transparent !important;
    border: none !important;
    border-radius: 18px !important;
    min-width: 52px !important; /* WCAG compliant - increased from 48px */
    height: 44px !important; /* WCAG compliant - increased from 34px to meet 44x44px minimum */
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 0.9rem !important; /* Increased from 0.85rem for readability */
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.4rem !important;
    padding: 0.5rem 0.625rem !important; /* More generous padding */
    position: relative !important;
}

.compact-vote-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.95);
    transform: scale(1.05);
}

.compact-vote-btn .vote-count {
    font-size: 0.875rem;
    font-weight: 700;
    color: inherit;
    text-shadow: none;
    min-width: 1.25rem;
    text-align: center;
}

.compact-vote-btn.upvote-btn:hover {
    color: var(--color-mystical-purple, #9d4edd);
}

.compact-vote-btn.challenge-btn:hover {
    color: var(--color-accent-gold, #ffca28);
}

.compact-vote-btn.upvote-btn.voted {
    background: rgba(157, 78, 221, 0.2);
    color: var(--color-mystical-purple, #9d4edd);
}

.compact-vote-btn.challenge-btn.voted {
    background: rgba(255, 202, 40, 0.2);
    color: var(--color-accent-gold, #ffca28);
}

.close-modal {
    background: rgba(255, 94, 120, 0.15) !important;
    border: 2px solid rgba(255, 94, 120, 0.3) !important;
    border-radius: 50% !important;
    width: 44px !important; /* WCAG compliant - increased from 38px */
    height: 44px !important; /* WCAG compliant - increased from 38px */
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 1.4rem !important; /* Increased from 1.3rem for better visibility */
    font-weight: bold !important;
    cursor: pointer !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    backdrop-filter: blur(10px) !important;
    flex-shrink: 0 !important;
}

.close-modal:hover {
    background: rgba(255, 94, 120, 0.3);
    border-color: rgba(255, 94, 120, 0.6);
    transform: rotate(90deg) scale(1.05);
    box-shadow: 0 0 24px rgba(255, 94, 120, 0.4);
    color: rgba(255, 255, 255, 1);
}

/* Challenge dropdown in modal header */
.modal-vote-controls {
    position: relative;
}

.modal-header-bar .challenge-dropdown,
.modal-header-bar .identity-challenge-dropdown,
.identity-challenge-dropdown {
    position: fixed !important; /* Changed from absolute to escape all container boundaries */
    top: auto !important; /* Will be set via JS */
    right: auto !important; /* Will be set via JS */
    left: auto !important; /* Will be set via JS */
    bottom: auto !important;
    z-index: 10001 !important; /* Above modal z-index */
    margin: 0 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.modal-header-bar .challenge-options {
    background: linear-gradient(135deg,
        rgba(26, 26, 51, 0.98),
        rgba(42, 64, 102, 0.95)
    );
    border: 2px solid rgba(255, 94, 120, 0.4);
    border-radius: 12px;
    padding: 0.5rem;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(255, 94, 120, 0.3);
    min-width: 200px;
    backdrop-filter: blur(10px);
}

.modal-header-bar .challenge-option {
    color: rgba(255, 255, 255, 0.9);
    background: transparent;
    border: 1px solid rgba(255, 94, 120, 0.2);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.modal-header-bar .challenge-option:last-child {
    margin-bottom: 0;
}

.modal-header-bar .challenge-option:hover {
    background: rgba(255, 94, 120, 0.2);
    border-color: rgba(255, 94, 120, 0.6);
    transform: translateX(-2px);
    color: rgba(255, 255, 255, 1);
}

/* ===== MODAL BODY ===== */
.modal-body {
    padding: 1.5rem;
    padding-top: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    position: relative;
    min-height: 0;
    cursor: auto;

    /* SCROLL PERFORMANCE OPTIMIZATIONS */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}

.modal-body * {
    cursor: auto; /* Ensure all child elements have normal cursor */
}

/* Custom scrollbar for modal body - optimized for smooth scrolling */
.modal-body::-webkit-scrollbar {
    width: 10px;
}

.modal-body::-webkit-scrollbar-track {
    background: rgba(26, 26, 51, 0.3);
    border-radius: 5px;
    margin: 0.5rem 0;
}

.modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg,
        rgba(255, 94, 120, 0.5),
        rgba(255, 202, 40, 0.5)
    );
    border-radius: 5px;
    border: 2px solid rgba(26, 26, 51, 0.3);
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg,
        rgba(255, 94, 120, 0.7),
        rgba(255, 202, 40, 0.7)
    );
    border-color: rgba(26, 26, 51, 0.5);
}

/* Firefox scrollbar */
.modal-body {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 94, 120, 0.5) rgba(26, 26, 51, 0.3);
}

/* ===== BODY SCROLL LOCK ===== */
body.modal-open {
    overflow: hidden !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

/* ===== MODAL LOADING STATE ===== */
.modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
}

.modal-spinner .relic-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 94, 120, 0.3);
    border-top: 3px solid rgba(255, 94, 120, 0.9);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== MODAL AUTHOR INFO (IN HEADER BAR) - ULTRA-COMPACT OPTIMIZATION ===== */
.modal-author-info {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important; /* Reduced from 0.75rem - tighter spacing (33% reduction) - !important to override blog-responsive.css */
    grid-column: 2;
    justify-self: start;
    min-width: 120px !important; /* Reduced from 150px - more compact (20% reduction) - !important to override conflicts */
    max-width: 100% !important; /* Prevent overflow in tight spaces */
    padding: 0.4rem 0.6rem !important; /* Reduced from 0.5rem 0.875rem - tighter padding (31% reduction) - !important to override blog-responsive.css */
    background: rgba(255, 94, 120, 0.06) !important; /* Lighter from 0.08 - subtle refinement */
    border-radius: 8px !important; /* Reduced from 12px - sharper, more compact feel */
    border-left: 2px solid rgba(255, 94, 120, 0.35) !important; /* Reduced from 3px - less horizontal space */
    overflow: hidden !important; /* Contain overflow */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important; /* Smooth micro-interactions */
    flex-shrink: 1 !important; /* Allow shrinking in tight spaces */
    flex-direction: row !important; /* CRITICAL: Override blog-responsive.css column layout */
    text-align: left !important; /* CRITICAL: Override blog-responsive.css center alignment */

    /* ABOVE AND BEYOND: Subtle depth enhancement */
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05),
                0 1px 2px rgba(0, 0, 0, 0.1) !important;
}

/* ABOVE AND BEYOND: Refined hover state */
.modal-author-info:hover {
    background: rgba(255, 94, 120, 0.1);
    border-left-color: rgba(255, 94, 120, 0.5);
    gap: 0.55rem; /* Slight expansion on hover for micro-feedback */
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08),
                0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Legacy blog-modal-header removed - now using unified header bar */
.blog-modal-header {
    display: none;
}

/* ===== MODAL TITLE ===== */
#modal-title {
    color: rgba(255, 255, 255, 0.95);
    font-family: 'Cinzel', serif;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 700;
    margin: 1rem 0 1rem 0; /* Reduced bottom margin from 1.5rem to 1rem, added 1rem top */
    line-height: 1.3;
    text-align: center;
    background: linear-gradient(135deg,
        rgba(255, 94, 120, 0.9),
        rgba(255, 202, 40, 0.8)
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* ===== MODAL CONTENT ===== */
#modal-content {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 2rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

#modal-content p {
    margin-bottom: 1.2rem;
}

#modal-content h1, #modal-content h2, #modal-content h3 {
    color: rgba(255, 94, 120, 0.9);
    font-family: 'Cinzel', serif;
    margin: 1.5rem 0 1rem 0;
}

#modal-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* ===== MODAL ACTIONS ===== */
.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 94, 120, 0.2);
    flex-wrap: wrap;
}

.modal-actions button {
    background: linear-gradient(135deg, 
        rgba(255, 94, 120, 0.8), 
        rgba(255, 202, 40, 0.7)
    );
    color: rgba(26, 26, 51, 0.95);
    border: 1px solid rgba(255, 94, 120, 0.4);
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Cinzel', serif;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
    text-decoration: none;
}

.modal-actions button:hover {
    background: linear-gradient(135deg, 
        rgba(255, 94, 120, 0.9), 
        rgba(255, 202, 40, 0.8)
    );
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 94, 120, 0.4);
}

.modal-actions button:focus {
    outline: 3px solid rgba(255, 94, 120, 0.6);
    outline-offset: 2px;
}

/* ===== COMMENTS SECTION ===== */
.blog-comments {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid rgba(255, 94, 120, 0.3);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    #blogModal.modal {
        padding: 0.5rem;
    }

    .scrolls-modal-content {
        max-height: 95vh;
        border-radius: 16px;
    }

    .modal-body {
        padding: 1.5rem !important;
        padding-top: 0 !important;
    }

    #modal-title {
        font-size: clamp(1.3rem, 5vw, 2rem);
    }

    .modal-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .modal-actions button {
        justify-content: center;
    }

    /* CONSOLIDATED: Header responsive styles for tablet */
    .modal-header-bar {
        padding: 0.75rem 1rem !important; /* Ease off compression - was 0.6rem 0.85rem */
        gap: 1rem !important;
    }

    .modal-vote-controls {
        gap: 0.5rem !important;
        padding: 0.3rem 0.5rem !important;
    }

    .compact-vote-btn {
        min-width: 48px !important;
        height: 44px !important; /* MAINTAIN WCAG compliance - was 32px */
        font-size: 0.85rem !important;
        gap: 0.35rem !important;
        padding: 0.4rem 0.5rem !important;
    }

    .compact-vote-btn .vote-count {
        font-size: 0.8rem !important;
    }

    .close-modal {
        width: 44px !important; /* MAINTAIN WCAG compliance - was 36px */
        height: 44px !important;
        font-size: 1.3rem !important;
    }

    .modal-author-info {
        min-width: 110px; /* Tightened from 120px for tablet */
        padding: 0.35rem 0.5rem; /* Further reduced from 0.4rem 0.7rem */
        gap: 0.45rem !important; /* Tighter gap for tablet */
        font-size: 0.95rem; /* Slight reduction for compactness */
    }
}

@media (max-width: 480px) {
    .modal-body {
        padding: 1rem !important;
        padding-top: 0 !important;
    }

    /* CONSOLIDATED: Mobile header styles */
    .modal-header-bar {
        padding: 0.75rem 1rem !important; /* SAME as tablet - NOT more compressed */
        gap: 0.85rem !important;
        grid-template-columns: minmax(110px, auto) 1fr minmax(44px, auto) !important;
    }

    .modal-vote-controls {
        gap: 0.4rem !important;
        padding: 0.25rem 0.45rem !important;
        border-radius: 20px !important;
    }

    .compact-vote-btn {
        min-width: 44px !important; /* WCAG minimum - never go below */
        height: 44px !important; /* WCAG minimum - never go below */
        font-size: 0.8rem !important;
        gap: 0.3rem !important;
        padding: 0.35rem 0.45rem !important;
    }

    .compact-vote-btn .vote-count {
        font-size: 0.75rem !important;
    }

    .close-modal {
        width: 44px !important; /* WCAG compliant - was 36px */
        height: 44px !important;
        font-size: 1.2rem !important;
    }

    .modal-author-info {
        min-width: 120px !important; /* MOBILE FIX: Increased from 90px to accommodate larger avatars */
        gap: 0.6rem !important; /* MOBILE FIX: Increased from 0.4rem for better avatar breathing room */
        font-size: 0.9rem !important; /* MOBILE FIX: Increased from 0.85rem for better readability */
        padding: 0.45rem 0.6rem !important; /* MOBILE FIX: Increased from 0.3rem 0.45rem for better touch targets */
        border-radius: 8px !important; /* MOBILE FIX: Increased from 6px for softer feel */
        border-left-width: 2px !important; /* MOBILE FIX: Increased from 1.5px for better visual hierarchy */
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    #blogModal.modal,
    .scrolls-modal-content,
    .close-modal,
    .modal-actions button {
        transition: none;
        animation: none;
    }
    
    .scrolls-modal-content::before {
        animation: none;
    }
}

@media (prefers-contrast: high) {
    .scrolls-modal-content {
        border-width: 3px;
        border-color: rgba(255, 94, 120, 0.8);
    }
    
    #modal-title,
    #modal-content {
        color: rgba(255, 255, 255, 1);
    }
}

/* ===== FOCUS MANAGEMENT ===== */
#blogModal.modal:focus-within {
    outline: none;
}

.modal-body:focus {
    outline: 2px solid rgba(255, 94, 120, 0.6);
    outline-offset: 2px;
}

/* ===== LEGACY VOTE SECTION (REMOVED - NOW IN HEADER) ===== */
/* Old prominent vote section removed - compact buttons now in modal header */
.modal-vote-section {
    display: none; /* Legacy section hidden */
}

.vote-container,
.vote-btn:not(.compact-vote-btn),
.vote-icon,
.vote-label,
.vote-divider {
    display: none; /* Legacy vote UI hidden */
}

/* Auto-link styling for clickable URLs */
.auto-link {
    color: var(--color-mystical-purple, #9d4edd);
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
    transition: all 0.2s ease;
    word-break: break-all;
}

.auto-link:hover {
    color: var(--color-accent-purple, #c77dff);
    text-decoration-style: solid;
    text-shadow: 0 0 8px rgba(157, 78, 221, 0.4);
}

/* NOTE: Duplicate 480px media query removed - all responsive styles consolidated above */

/* ===== MODAL VOTING BUTTONS (Bottom Position) ===== */
.modal-voting-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin: 0 1rem 1rem 0;
}

.modal-voting-buttons .vote-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: 2px solid rgba(255, 94, 120, 0.3);
    border-radius: 12px;
    background: linear-gradient(135deg,
        rgba(26, 26, 51, 0.6),
        rgba(42, 64, 102, 0.4)
    );
    color: var(--text-secondary, #c9b3e0);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.modal-voting-buttons .vote-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 94, 120, 0.6);
    box-shadow:
        0 8px 16px rgba(0, 0, 0, 0.3),
        0 4px 8px rgba(255, 94, 120, 0.2);
}

.modal-voting-buttons .vote-btn i {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.modal-voting-buttons .vote-btn:hover i {
    transform: scale(1.2);
}

.modal-voting-buttons .vote-count {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text, #f0e6ff);
    min-width: 2ch;
    text-align: center;
}

.modal-voting-buttons .vote-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Upvote button specific styling */
.modal-voting-buttons .upvote-btn {
    border-color: rgba(76, 175, 80, 0.3);
}

.modal-voting-buttons .upvote-btn:hover {
    border-color: rgba(76, 175, 80, 0.6);
    box-shadow:
        0 8px 16px rgba(0, 0, 0, 0.3),
        0 4px 8px rgba(76, 175, 80, 0.2);
}

.modal-voting-buttons .upvote-btn.voted {
    background: linear-gradient(135deg,
        rgba(76, 175, 80, 0.3),
        rgba(56, 142, 60, 0.2)
    );
    border-color: rgba(76, 175, 80, 0.8);
    color: #4caf50;
}

.modal-voting-buttons .upvote-btn.voted i {
    color: #4caf50;
}

/* Challenge button specific styling */
.modal-voting-buttons .challenge-btn {
    border-color: rgba(255, 152, 0, 0.3);
}

.modal-voting-buttons .challenge-btn:hover {
    border-color: rgba(255, 152, 0, 0.6);
    box-shadow:
        0 8px 16px rgba(0, 0, 0, 0.3),
        0 4px 8px rgba(255, 152, 0, 0.2);
}

.modal-voting-buttons .challenge-btn.voted {
    background: linear-gradient(135deg,
        rgba(255, 152, 0, 0.3),
        rgba(245, 124, 0, 0.2)
    );
    border-color: rgba(255, 152, 0, 0.8);
    color: #ff9800;
}

.modal-voting-buttons .challenge-btn.voted i {
    color: #ff9800;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .modal-voting-buttons {
        flex-direction: column;
        gap: 0.75rem;
        margin: 0 0.5rem 1rem 0;
    }

    .modal-voting-buttons .vote-btn {
        width: 100%;
        justify-content: center;
        padding: 1rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .modal-voting-buttons .vote-label {
        font-size: 0.85rem;
    }

    .modal-voting-buttons .vote-btn {
        padding: 0.875rem 1.25rem;
    }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    .scrolls-modal-content {
        background: linear-gradient(135deg,
            rgba(13, 13, 26, 0.98),
            rgba(21, 32, 51, 0.95)
        );
    }
}