:root {
    /* Light theme (default) */
    --bg-color: #ffffff;
    --text-color: #333333;
    --section-bg: #ffffff;
    --answer-bg: #ffffff;
    --answer-hover: #f8f9fa;
    --answer-number-bg: #ffffff;
    --answer-number-color: #333333;
    --answer-number-border: #e5e7eb;
    --modal-overlay: rgba(0, 0, 0, 0.7);
    --box-shadow: rgba(0, 0, 0, 0.1);
    --border-color: #e5e7eb;
    --text-secondary: #6c757d;
    --theme-switch-color: #495057;
    --placeholder-bg: #f8f9fa;
    --pagination-text: #495057;
    --link-color: #2196F3;
    --question-bg: rgba(255, 255, 255, 0.98);
    --question-text: #333333;
    --question-border: rgba(0, 0, 0, 0.1);
    --ticket-number-bg: rgba(33, 150, 243, 0.95);
    --correct-bg: rgba(76, 175, 80, 0.1);
    --incorrect-bg: rgba(244, 67, 54, 0.1);
    --correct-glow: rgba(76, 175, 80, 0.2);
    --incorrect-glow: rgba(244, 67, 54, 0.2);
    --category-color: #2196F3;
    --number-box-shadow: rgba(0, 0, 0, 0.08);
    --question-bg-rgb: 255, 255, 255;
    --question-shadow: rgba(0, 0, 0, 0.08);
    --question-highlight: rgba(255, 255, 255, 1);
    --question-gradient-start: rgba(255, 255, 255, 0.95);
    --question-gradient-end: rgba(255, 255, 255, 0.98);
    --notification-bg: #ffffff;
    --notification-border: #2196F3;
    --notification-text: #333333;
    --notification-shadow: rgba(0, 0, 0, 0.1);
    --notification-button-bg: #2196F3;
    --notification-button-hover: #1976D2;
    --notification-close-bg: #f5f5f5;
    --notification-close-hover: #e0e0e0;
}

[data-theme="dark"] {
    /* Dark theme overrides */
    --bg-color: #1a1a1a;
    --text-color: #f5f5f5;
    --section-bg: #242424;
    --answer-bg: #2d2d2d;
    --answer-hover: #383838;
    --answer-number-bg: #404040;
    --answer-number-color: #ffffff;
    --modal-overlay: rgba(0, 0, 0, 0.85);
    --box-shadow: rgba(0, 0, 0, 0.2);
    --theme-switch-color: #ffffff;
    --placeholder-bg: #2d2d2d;
    --pagination-text: #ffffff;
    --question-bg: rgba(35, 35, 35, 0.95);
    --ticket-number-bg: rgba(33, 150, 243, 0.95);
    --correct-bg: rgba(76, 175, 80, 0.15);
    --incorrect-bg: rgba(244, 67, 54, 0.15);
    --correct-glow: rgba(76, 175, 80, 0.25);
    --incorrect-glow: rgba(244, 67, 54, 0.25);
    --category-color: #2196F3;
    --number-box-shadow: rgba(0, 0, 0, 0.15);
    --border-color: #404040;
    --question-bg-rgb: 35, 35, 35;
    --question-shadow: rgba(0, 0, 0, 0.2);
    --question-highlight: rgba(255, 255, 255, 0.1);
    --question-gradient-start: rgba(35, 35, 35, 0.92);
    --question-gradient-end: rgba(35, 35, 35, 0.98);
    --notification-bg: #242424;
    --notification-border: #2196F3;
    --notification-text: #e0e0e0;
    --notification-shadow: rgba(0, 0, 0, 0.3);
    --notification-button-bg: #2196F3;
    --notification-button-hover: #1976D2;
    --notification-close-bg: #383838;
    --notification-close-hover: #424242;
}

@font-face {
    font-family: 'BPG Arial 2009';
    src: url('../fonts/bpg_arial_2009.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'BPG Arial 2009', 'Noto Sans Georgian', sans-serif;
    padding: 20px;
}

.preview-section {
    padding: 20px;
    background-color: var(--section-bg);
    border-radius: 8px;
    max-width: 800px;
    margin: 0 auto;
    padding-bottom: 40px; /* Add bottom padding for consistent spacing */
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
}

.image-container {
    position: relative;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

.image-container img {
    width: 100%;
    height: auto !important;
    max-height: 60vh !important; /* Force maximum height relative to viewport */
    object-fit: contain;
    display: block;
}

.image-container .image-question {
    position: relative; /* Change from absolute to relative */
    bottom: auto;
    margin-top: -1px; /* Slight overlap to avoid gap */
    background: var(--question-bg);
    z-index: 2;
}

.image-number {
    position: absolute;
    top: 10px; /* Changed from 55px to 10px to match mobile */
    left: 10px;
    background: var(--ticket-number-bg);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 16px;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.image-question {
    position: absolute;
    bottom: 45px; /* Changed from 38px */
    left: 0;
    right: 0;
    padding: 18px 25px;
    font-size: 18px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.5;
    color: var(--question-text);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: linear-gradient(
        to bottom,
        var(--question-gradient-start) 0%,
        var(--question-gradient-end) 100%
    );
    border: 1px solid var(--question-highlight);
    box-shadow: 0 4px 20px var(--question-shadow);
    transition: all 0.3s ease;
    z-index: 2;
    letter-spacing: 0.3px;
    transform: translateZ(0);
    -webkit-font-smoothing: antialiased;
    font-weight: 500;
}

[data-theme="dark"] .image-question {
    color: #f5f5f5;
    background: rgba(35, 35, 35, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.answer-box {
    background: var(--answer-bg);
    padding: 20px;
    border-radius: 12px;  /* Increased border radius */
    display: flex;
    align-items: center;
    min-height: 70px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 2px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);  /* Added subtle shadow */
    color: var(--text-color);  /* Add this to handle both themes */
    -webkit-tap-highlight-color: transparent;  /* Remove tap highlight on iOS */
    -webkit-touch-callout: none;              /* Disable callout on iOS */
    -webkit-user-select: none;                /* Disable text selection */
    user-select: none;                        /* Disable text selection */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(var(--answer-bg), 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.answer-box.disabled {
    cursor: default;
    pointer-events: none;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.answer-box.disabled:hover {
    background: var(--answer-bg);
}

.answer-box:hover {
    transform: translateY(-3px);  /* Slight lift effect */
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);  /* Enhanced shadow on hover */
    background: var(--answer-hover);
}

.answer-box.correct {
    background: var(--correct-bg);
    border: 2px solid #4CAF50;  /* Change from border-color to direct border */
    box-shadow: 0 0 20px var(--correct-glow);
    transform: scale(1.02);
    color: var(--text-color);
}

.answer-box.incorrect {
    background: var(--incorrect-bg);
    border: 2px solid #f44336;  /* Change from border-color to direct border */
    box-shadow: 0 0 20px var(--incorrect-glow);
    animation: shake 0.4s linear;
    color: var(--text-color);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.answer-box.correct .answer-number {
    background: #4CAF50;
    color: white;
    transform: scale(1.1);
}

.answer-box.incorrect .answer-number {
    background: #f44336;
    color: white;
    transform: scale(1.1);
}

.answer-number {
    min-width: 45px;
    width: 45px;
    min-height: 45px;
    height: 45px;
    flex: 0 0 45px;
    background: var(--answer-number-bg);
    color: var(--answer-number-color);
    border: 1px solid var(--answer-number-border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    font-size: 20px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.answers-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 10px;
}

button {
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 20px;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--modal-overlay);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--section-bg);
    padding: 20px;
    border-radius: 8px;
    width: 95%;
    max-width: 1400px;
    max-height: 85vh;
    overflow-y: auto;
}

.tickets-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 20px;
}

.ticket-card {
    background: var(--answer-bg);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    cursor: pointer;
    min-width: 250px;
}

.ticket-card img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    border-radius: 4px;
    background: var(--section-bg);
}

.stats-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--section-bg);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(var(--section-bg), 0.8);
    border-radius: 16px;
    padding: 15px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-counter {
    font-size: 18px;
    font-weight: bold;
    white-space: nowrap;
    flex: 0 0 auto;
    width: 80px; /* Fixed width for counter */
}

.stats-counter span:first-child {
    color: #4CAF50;  /* Green for correct answers */
}

.stats-counter span:last-child {
    color: #f44336;  /* Red for incorrect answers */
}

.category-wrapper {
    position: relative;
    flex: 1 1 auto;
    margin: 0 20px;
    display: flex;
    justify-content: center;
}

.category-name {
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s;
    color: var(--category-color);
    text-align: center;
    background: rgba(33, 150, 243, 0.1);
    border: 1px solid rgba(33, 150, 243, 0.2);
    padding: 8px 16px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.category-name:hover {
    background: rgba(33, 150, 243, 0.2);
    transform: translateY(-1px);
}

.category-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--section-bg);
    border-radius: 8px;
    margin-top: 5px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 200;
    max-height: 40vh; /* Changed from 400px to 40vh */
    overflow-y: auto;
    width: 30vw;
}

.category-dropdown.show {
    display: block;
}

.category-item {
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
    text-align: center; /* Add this */
}

.category-item:hover {
    background-color: var(--answer-bg);
}

.timer {
    font-size: 18px;
    font-weight: bold;
    color: #2196F3;  /* Blue for timer */
    white-space: nowrap; /* Prevent breaking */
    flex: 0 0 auto; /* Don't grow or shrink */
    width: 80px; /* Fixed width for timer */
    text-align: right;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0 40px; /* Increased bottom margin */
    flex-wrap: wrap;
    padding: 0 15px;
}

.pagination button {
    margin: 0;
    min-width: 40px;
    width: 40px; /* Add fixed width */
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--answer-bg);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    font-size: 16px;
    color: var(--pagination-text);
    cursor: pointer;
}

.pagination button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    background: var(--answer-hover);
}

.pagination button.active {
    background-color: #2196F3;
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(33, 150, 243, 0.2);
    color: white;  /* Always white for active button */
}

.welcome-instruction {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;  /* Increased from 300px */
    text-align: center;
    color: var(--category-color);
    position: relative;
}

.welcome-instruction h2 {
    font-size: 24px;
    margin: 0;
    animation: pulse 2s infinite;
}

.arrow-up {
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-bottom: 20px solid var(--category-color);
    position: absolute;
    top: -30px; /* Changed from -40px */
    animation: bounce 2s infinite;
    z-index: 101; /* Added z-index to appear above stats-bar */
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@media (max-width: 768px) {
    body { 
        padding: 0;  /* Remove all padding */
        margin: 0;   /* Remove all margin */
    }
    
    .preview-section { 
        padding: 10px;
        margin: 5px;
        border-radius: 8px;  /* Add this */
        padding: 0;  /* Remove padding */
        margin: 0;   /* Remove margin */
        width: 100%; /* Full width */
        max-width: 100%;
        border-radius: 0;
        padding-bottom: 40px; /* Add bottom padding for consistent spacing */
    }
    
    .image-container { 
        margin-bottom: 15px;
        padding-bottom: 0; /* Remove fixed padding */
        display: flex;
        flex-direction: column;
        margin: 0;   /* Remove margin */
        width: 100vw;  /* Full viewport width */
        margin-left: -5px;  /* Compensate for body padding */
        margin-right: -5px; /* Compensate for body padding */
        width: 100vw;
        max-width: 100vw;
    }
    
    .image-container img { 
        height: auto !important;
        max-height: 50vh; /* Reduce image height to make more room for question */
        width: 100%;
        object-fit: contain;
        width: 100vw !important;  /* Force full viewport width */
        max-width: none;          /* Remove max-width limitation */
        height: auto !important;
        max-height: 60vh;         /* Limit height to 60% of viewport height */
        object-fit: contain;
        width: 100vw;
        max-width: none;
        height: auto;
        max-height: 60vh;
        object-fit: contain;
    }
    
    .image-number {
        top: 10px;
        left: 10px;
        padding: 6px 10px;
        font-size: 14px;
    }
    
    .image-question {
        position: relative; /* Change from absolute to relative */
        font-size: 14px;
        padding: 12px 15px;
        min-height: auto;
        max-height: none; /* Remove max height */
        bottom: auto; /* Remove bottom positioning */
        margin-top: -1px; /* Slight overlap to avoid gap */
        overflow-y: visible; /* Remove scroll */
        background: rgba(48, 48, 56, 0.98);
        padding: 15px 20px;
        font-size: 16px;
        background: var(--question-bg);  /* Ensure background is applied on mobile */
        border: 1px solid var(--question-border, rgba(255, 255, 255, 0.1));
        padding: 16px 20px;
        font-size: 16px;
        background: linear-gradient(
            to bottom,
            var(--question-gradient-start) 0%,
            var(--question-gradient-end) 100%
        );
        border-top: 1px solid var(--question-highlight);
        border-bottom: 1px solid var(--question-shadow);
    }
    
    .answers-grid { 
        grid-template-columns: 1fr;
        gap: 6px;  /* Reduced from 8px */
        margin-top: 6px;  /* Reduced from 8px */
        padding: 10px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .answer-box {
        padding: 12px;
        min-height: 60px;
        font-size: 16px;
        touch-action: manipulation;
        padding: 15px;
        margin: 0;  /* Remove margin */
    }
    
    .modal-content {
        padding: 10px;
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .tickets-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 10px;
    }
    
    .ticket-card {
        min-width: auto;
        padding: 12px;
    }
    
    .ticket-card img {
        height: 150px;
    }

    button {
        padding: 12px 24px;
        font-size: 16px;
        width: 100%;
        max-width: 200px;
    }

    .stats-bar {
        padding: 10px;
        font-size: 14px;
        border-radius: 8px;  /* Change from 0 to 8px */
        margin: 0;
        width: 100%;
        border-radius: 0;
        padding: 10px;
        box-sizing: border-box;
        margin-bottom: 20px; /* Increased from 15px */
        border-radius: 0;
        padding: 12px 15px;
        margin: 0;
    }
    
    .stats-counter, .category-name, .timer {
        font-size: 14px;
    }

    .category-dropdown {
        width: 90vw; /* Make dropdown wider on mobile */
        left: 50%;
        transform: translateX(-50%); /* Center the dropdown */
        margin-top: 10px;
    }
    
    .category-item {
        padding: 15px; /* Increase padding for better touch targets */
        font-size: 16px; /* Slightly larger font for mobile */
    }

    .welcome-instruction {
        min-height: 300px;  /* Increased from 200px for mobile */
    }

    .welcome-instruction h2 {
        font-size: 20px;
    }

    .placeholder-container {
        background: var(--placeholder-bg) !important;
        height: 250px !important; /* Reduced from 400px */
    }

    .controls {
        width: 100%;
        padding: 10px;
        box-sizing: border-box;
    }

    .controls-wrapper {
        width: 100%;
        margin: 0;
        border-radius: 8px;
    }

    .image-container {
        width: 100vw;
        margin: 0;
        padding: 0;
    }

    .image-container img {
        width: 100vw !important;
        height: auto !important;
        max-width: none;
    }

    .preview-section {
        padding: 0;
        margin: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 0;
    }

    .answers-grid {
        padding: 10px;
        width: 100%;
        box-sizing: border-box;
    }

    .arrow-up {
        top: -15px; /* Move down from -25px */
    }

    .pagination {
        gap: 8px;
        margin: 15px 0;
        padding: 0 10px;
    }

    .pagination button {
        min-width: 40px; /* Match desktop size */
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    .social-button {
        width: 45px;  /* Slightly larger on mobile */
        height: 45px;
    }
    
    .social-button i {
        font-size: 20px;
    }

    .explain-btn {
        top: 10px;
        right: 10px;
        padding: 6px 10px;
        font-size: 14px;
        height: 32px;
    }
}

@media screen and (max-width: 480px) {
    .image-container {
        width: 100vw;
        margin: 0;
        padding: 0;
    }

    .image-container img {
        width: 100vw !important;
        height: auto !important;
        max-width: none;
    }

    .preview-section {
        padding: 0;
        margin: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        padding-bottom: 20px; /* Reduced from 40px */
    }

    .answers-grid {
        padding: 8px;
        gap: 5px;  /* Reduced from 6px */
        width: 100%;
        box-sizing: border-box;
    }

    .stats-bar {
        padding: 6px;
        gap: 6px;
        margin-bottom: 15px; /* Increased from 12px */
        padding: 10px;
    }

    .arrow-up {
        top: -12px; /* Move down from -20px */
    }

    .pagination {
        gap: 6px;
        margin: 15px 0 20px; /* Adjusted margins */
        padding: 0 8px;
    }

    .pagination button {
        min-width: 40px; /* Match desktop size */
        width: 40px;
        height: 40px;
        font-size: 13px;
    }

    .placeholder-container {
        height: 200px !important; /* Even smaller for very small screens */
    }

    .image-question {
        padding: 14px 18px;
        font-size: 15px;
        line-height: 1.4;
    }
}

@media screen and (max-width: 380px) {
    .stats-bar {
        padding: 6px;
        gap: 6px;
        margin-bottom: 12px; /* Increased from 10px */
    }

    .timer, .stats-counter {
        width: 60px;
        font-size: 12px;
    }

    .category-wrapper {
        margin: 0 8px;
    }

    .category-name {
        font-size: 13px;
        padding: 4px 8px;
    }

    .answer-box {
        padding: 8px;
        font-size: 14px;
    }

    .answer-number {
        min-width: 32px;
        width: 32px;
        height: 32px;
        font-size: 14px;
        margin-right: 8px;
    }

    .preview-section {
        padding: 8px;
        margin: 4px;
        padding-bottom: 20px; /* Reduced from 40px */
    }

    .image-container {
        width: 100vw;
        margin: 0;
        padding: 0;
    }

    .image-container img {
        width: 100vw !important;
        height: auto !important;
        max-width: none;
    }

    .preview-section {
        padding: 0;
        margin: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 0;
    }

    .answers-grid {
        padding: 6px;
        gap: 4px;  /* Reduced from 5px */
        width: 100%;
        box-sizing: border-box;
    }

    .arrow-up {
        top: -10px; /* Move down from -15px */
    }

    .pagination {
        gap: 4px;
        margin: 15px 0 20px; /* Adjusted margins */
        padding: 0 5px;
    }

    .pagination button {
        min-width: 40px; /* Match desktop size */
        width: 40px;
        height: 40px;
        font-size: 12px;
    }

    .social-button {
        width: 45px; /* Fixed width instead of 100% */
        height: 45px; /* Keep it square */
        min-width: 45px; /* Prevent squishing */
        padding: 0;
        margin: 0 5px; /* Add some spacing between buttons */
    }
    
    .social-buttons {
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px; /* Consistent gap between buttons */
    }
}

.go-up-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(33, 150, 243, 0.9); /* Changed to match timer blue color */
    color: white;
    border-radius: 50%;
    display: none;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 18px; /* Adjusted for Font Awesome icon */
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.go-up-button:hover {
    background: rgba(33, 150, 243, 1); /* Changed to match timer blue color */
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

@media (max-width: 768px) {
    .go-up-button {
        bottom: 15px;
        right: 15px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
}

.footer {
    background: var(--section-bg);
    padding: 40px 0 20px;
    margin-top: 40px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
    border-radius: 8px; /* Added border radius */
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.footer-section h3 {
    color: var(--text-secondary);  /* Changed to use dynamic color */
    font-size: 18px;
    margin-bottom: 10px;
}

.social-link {
    color: var(--link-color);  /* Change from white to variable */
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: color 0.3s;
}

.social-link:hover {
    color: #2196F3;
}

.social-buttons {
    display: flex;
    flex-direction: row;
    gap: 15px;
    align-items: center;
    justify-content: flex-start;  /* Changed from center to flex-start */
}

.social-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;  /* Fixed size */
    height: 40px;  /* Fixed size */
    padding: 0;
    border-radius: 50%;  /* Make it round */
    text-decoration: none;
    color: white;
    transition: all 0.3s ease;
}

.social-button span {
    display: none;  /* Hide text */
}

.social-button i {
    font-size: 18px;  /* Larger icons */
}

.social-button.facebook {
    background: #1877f2;
}

.social-button.instagram {
    background: #e4405f;
}

.social-button.tiktok {
    background: #000000;
}

.social-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.map-container {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.directions-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #2196F3;
    color: white;
    text-decoration: none;
    padding: 10px;
    border-radius: 6px;
    transition: all 0.3s;
}

.directions-button:hover {
    background: #1976d2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #3d3d3d;
    color: #888;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-section {
        text-align: center;
        align-items: center;
    }

    .social-buttons {
        justify-content: center;  /* Keep centered on mobile */
    }

    .social-button {
        width: 45px;  /* Slightly larger on mobile */
        height: 45px;
    }
    
    .social-button i {
        font-size: 20px;
    }
}

@media screen and (max-width: 480px) {
    .footer {
        padding: 30px 0 15px;
        margin-top: 30px;
    }

    .footer-content {
        padding: 0 15px;
    }
}

@media screen and (max-width: 380px) {
    .social-button {
        width: 45px; /* Fixed width instead of 100% */
        height: 45px; /* Keep it square */
        min-width: 45px; /* Prevent squishing */
        padding: 0;
        margin: 0 5px; /* Add some spacing between buttons */
    }
    
    .social-buttons {
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px; /* Consistent gap between buttons */
    }
}

.theme-switch {
    padding: 8px 15px;  /* Reduced from 10px 20px */
    border-radius: 30px;
    border: 2px solid var(--border-color) !important; /* Added border */
    background: linear-gradient(145deg, var(--section-bg), var(--answer-hover));
    color: var(--text-color); /* Changed to use dynamic color */
    cursor: pointer;
    font-size: 14px;    /* Reduced from 16px */
    display: flex;
    align-items: center;
    gap: 8px;          /* Reduced from 12px */
    margin-top: 10px;   /* Reduced from 25px */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); /* Enhanced shadow */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    position: relative;
    overflow: hidden;
    min-width: unset;  /* Added to prevent stretching */
    width: auto;       /* Added to make button fit content */
}

.theme-switch::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0));
    border-radius: 30px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.theme-switch:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25); /* Enhanced hover shadow */
    border-color: var(--category-color) !important; /* Highlight border on hover */
}

.theme-switch:hover::before {
    opacity: 1;
}

.theme-switch i {
    font-size: 16px;    /* Reduced from 18px */
    color: var(--text-color); /* Changed to use dynamic color */
}

[data-theme="dark"] .theme-switch {
    background: linear-gradient(145deg, #1a1a1a, #242424);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    color: #ffffff; /* Keep white for dark theme */
    border: 2px solid rgba(33, 150, 243, 0.3) !important; /* Blue-tinted border for dark theme */
}

[data-theme="dark"] .theme-switch i {
    color: #ffffff; /* Keep white for dark theme */
}

.placeholder-container {
    background: var(--placeholder-bg) !important;
}

.home-button {
    padding: 10px 20px;  /* Reduced from 12px 24px */
    border-radius: 30px;
    border: 2px solid var(--border-color) !important; /* Added border */
    background: linear-gradient(145deg, var(--section-bg), var(--answer-hover));
    color: var(--text-color); /* Changed to use dynamic color */
    cursor: pointer;
    font-size: 14px;    /* Reduced from 16px */
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 15px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); /* Enhanced shadow */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    position: relative;
    overflow: hidden;
}

.home-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0));
    border-radius: 30px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.home-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25); /* Enhanced hover shadow */
    border-color: var(--category-color) !important; /* Highlight border on hover */
}

.home-button:hover::before {
    opacity: 1;
}

.home-button i {
    font-size: 16px;    /* Reduced from 18px */
    color: var(--text-color); /* Changed to use dynamic color */
}

[data-theme="dark"] .home-button {
    background: linear-gradient(145deg, #1a1a1a, #242424);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    color: #ffffff; /* Keep white for dark theme */
    border: 2px solid rgba(33, 150, 243, 0.3) !important; /* Blue-tinted border for dark theme */
}

[data-theme="dark"] .home-button i {
    color: #ffffff; /* Keep white for dark theme */
}

/* Purchase notification styles */
.purchase-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    max-width: 350px;
    background: var(--notification-bg);
    color: var(--notification-text);
    border-radius: 10px;
    box-shadow: 0 4px 15px var(--notification-shadow);
    z-index: 9999;
    border-left: 4px solid var(--notification-border);
    overflow: hidden;
    animation: slideIn 0.3s ease-out forwards;
}

.purchase-notification.hiding {
    animation: slideOut 0.3s ease-in forwards;
}

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

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

.notification-content {
    padding: 20px;
}

.notification-content h3 {
    margin: 0 0 12px 0;
    font-size: 18px;
    color: var(--notification-border);
    font-weight: 600;
}

.notification-content p {
    margin: 0 0 20px 0;
    font-size: 14px;
    line-height: 1.5;
    opacity: 0.9;
}

.notification-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.notification-actions button {
    padding: 10px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    margin: 0;
}

.notification-actions .action-button {
    background: var(--notification-button-bg);
    color: white;
    flex: 2;
    font-weight: 500;
}

.notification-actions .action-button:hover {
    background: var(--notification-button-hover);
    transform: translateY(-1px);
}

.notification-actions .close-button {
    background: var(--notification-close-bg);
    color: var(--notification-text);
    flex: 1;
}

.notification-actions .close-button:hover {
    background: var(--notification-close-hover);
}

@media (max-width: 480px) {
    .purchase-notification {
        max-width: 90%;
        left: 5%;
        right: 5%;
        bottom: 10px;
    }
}

@media (max-width: 380px) {
    .purchase-notification {
        max-width: 95%;
        left: 2.5%;
        right: 2.5%;
    }
    
    .notification-content {
        padding: 15px;
    }
    
    .notification-content h3 {
        font-size: 16px;
    }
    
    .notification-content p {
        font-size: 13px;
        margin-bottom: 15px;
    }
    
    .notification-actions button {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* Remove all previous explain-btn styles and add these new ones */
.explain-btn {
    position: absolute;
    top: 10px; /* Match ticket number top position */
    right: 10px;
    padding: 8px 12px;
    height: 35px; /* Match ticket number height */
    background: var(--ticket-number-bg);
    color: white;
    border: none;
    border-radius: 4px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    font-size: 16px;
    line-height: 1;
    margin: 0;
    transform: translateY(0); /* Remove any vertical offset */
}

.explain-btn .play-icon,
.explain-btn .stop-icon {
    font-size: 16px;
    line-height: 1;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.explain-btn .stop-icon {
    font-size: 14px;
    padding-bottom: 1px; /* Slight adjustment to vertically center the square */
}

@media (max-width: 768px) {
    .explain-btn .play-icon,
    .explain-btn .stop-icon {
        font-size: 14px;
        width: 14px;
        height: 14px;
    }
    
    .explain-btn .stop-icon {
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    .explain-btn {
        padding: 6px 10px;
        height: 32px; /* Match mobile ticket number height */
        font-size: 14px;
    }
}

.explain-btn.active {
    display: flex;
}

.explain-btn:hover {
    transform: translateY(-2px);
    background: rgba(33, 150, 243, 1); /* Solid blue on hover */
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.explain-btn.playing {
    background: rgba(33, 150, 243, 0.85);
    box-shadow: 0 0 15px rgba(33, 150, 243, 0.3);
}

.explain-btn .play-icon,
.explain-btn .stop-icon {
    line-height: 1;
}

@media (max-width: 768px) {
    .explain-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
        padding: 6px 10px;
    }
}

.loading-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.loading-content {
    background: var(--section-bg);
    padding: 20px 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--notification-border);
    border-top: 3px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    color: var(--text-color);
    font-size: 16px;
    font-weight: 500;
}

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