/* ============================================
   Reset & Base Styles
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette - Music Samurai Theme */
    --primary-color: #1f7cec;
    --primary-dark: #0a284b;
    --primary-light: #3993ff;
    --secondary-color: #0a284b;
    --accent-color: #1f7cec;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;

    /* Neutral Colors - Light Theme */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-color: #e2e8f0;

    /* Top 3 Leaderboard Colors */
    --gold: #fbbf24;
    --silver: #94a3b8;
    --bronze: #cd7f32;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;

    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-size-base: 16px;
    --font-size-sm: 0.875rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    --font-size-4xl: 2.5rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);

    /* Glow Effects */
    --glow-primary: 0 0 20px rgba(31, 124, 236, 0.5);
    --glow-success: 0 0 20px rgba(16, 185, 129, 0.5);
    --glow-error: 0 0 20px rgba(239, 68, 68, 0.5);

    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 200ms ease-in-out;
    --transition-slow: 300ms ease-in-out;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    background: var(--bg-primary);
    background-image:
        radial-gradient(at 40% 20%, rgba(31, 124, 236, 0.03) 0px, transparent 50%),
        radial-gradient(at 80% 80%, rgba(10, 40, 75, 0.02) 0px, transparent 50%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
}

/* ============================================
   Integrated Logo & Header
   ============================================ */
.app-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

.app-logo-link {
    display: inline-block;
    transition: opacity var(--transition-base);
    flex-shrink: 0;
}

.app-logo-link:hover {
    opacity: 0.8;
}

.app-logo {
    height: 120px;
    width: auto;
    object-fit: contain;
}

.app-header h1 {
    margin: 0;
    color: #000000; /* Black */
}

/* ============================================
   Layout
   ============================================ */
.leaderboard-panel {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(10px);
}

.main-content {
    flex: 1;
    margin-left: 280px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
}

.container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

/* ============================================
   Leaderboard Styles
   ============================================ */
.leaderboard-panel h2 {
    font-size: var(--font-size-xl);
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
    text-align: center;
}

.leaderboard-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.leaderboard-item:hover {
    background: var(--bg-tertiary);
    transform: translateX(4px);
}

.leaderboard-item.top-1 {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(251, 191, 36, 0.1));
    border-color: var(--gold);
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
}

.leaderboard-item.top-2 {
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.2), rgba(148, 163, 184, 0.1));
    border-color: var(--silver);
    box-shadow: 0 0 15px rgba(148, 163, 184, 0.2);
}

.leaderboard-item.top-3 {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.2), rgba(205, 127, 50, 0.1));
    border-color: var(--bronze);
    box-shadow: 0 0 15px rgba(205, 127, 50, 0.2);
}

/* Current User Highlight */
.leaderboard-item.current-user {
    background: linear-gradient(135deg, rgba(31, 124, 236, 0.2), rgba(31, 124, 236, 0.1));
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(31, 124, 236, 0.3);
    animation: currentUserPulse 2s ease-in-out infinite;
}

.leaderboard-item.current-user .name {
    color: var(--primary-dark);
    font-weight: 600;
}

.leaderboard-item.current-user .score {
    color: var(--primary-color);
    font-size: var(--font-size-xl);
    font-weight: 700;
}

@keyframes currentUserPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(31, 124, 236, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(31, 124, 236, 0.5);
    }
}

.leaderboard-item .rank {
    font-weight: bold;
    font-size: var(--font-size-lg);
    min-width: 30px;
    text-align: center;
    flex-shrink: 0;
}

.leaderboard-item.top-1 .rank {
    color: var(--gold);
}

.leaderboard-item.top-2 .rank {
    color: var(--silver);
}

.leaderboard-item.top-3 .rank {
    color: var(--bronze);
}

.leaderboard-item .name {
    flex: 1;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.leaderboard-item .score {
    font-weight: bold;
    color: var(--primary-light);
    min-width: 50px;
    text-align: right;
    flex-shrink: 0;
}

.leaderboard-footer {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.leaderboard-footer small {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

/* ============================================
   Screen Management
   ============================================ */
.screen {
    display: none;
    width: 100%;
    animation: fadeIn 0.3s ease;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Landing Screen
   ============================================ */
.landing-screen h1 {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--spacing-sm);
    text-align: center;
    color: #000000;
    text-transform: uppercase;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xl);
    font-size: var(--font-size-lg);
}

.entry-form {
    background: var(--bg-secondary);
    padding: var(--spacing-xl);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-base);
}

.entry-form:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-2px);
}

.entry-form label {
    display: block;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
    font-weight: 500;
}

.entry-form input {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--font-size-base);
    margin-bottom: var(--spacing-md);
    transition: all var(--transition-base);
}

.entry-form input:hover {
    border-color: var(--primary-light);
}

.entry-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(31, 124, 236, 0.1), var(--glow-primary);
    transform: translateY(-1px);
}

.entry-form input::placeholder {
    color: var(--text-muted);
}

.entry-form input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

.instructions {
    background: var(--bg-secondary);
    padding: var(--spacing-lg);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-base);
}

.instructions:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-2px);
}

.instructions h3 {
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.instructions ul {
    list-style: none;
    padding-left: 0;
}

.instructions li {
    padding: var(--spacing-xs) 0;
    padding-left: var(--spacing-lg);
    position: relative;
    color: var(--text-secondary);
}

.instructions li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
}

/* ============================================
   Quiz Screen
   ============================================ */
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.question-counter {
    font-size: var(--font-size-xl);
    color: var(--text-secondary);
}

.question-counter .current {
    font-size: var(--font-size-3xl);
    font-weight: bold;
    color: var(--primary-light);
}

.score-display {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
}

.score-display strong {
    color: var(--success-color);
    font-size: var(--font-size-xl);
}

/* Quiz Volume Control */
.quiz-volume-control {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    margin: var(--spacing-sm) auto;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.quiz-volume-control label {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    font-weight: 500;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

#volume-slider {
    width: 70px;
    height: 3px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-primary);
    border-radius: var(--radius-full);
    outline: none;
    cursor: pointer;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-base);
}

#volume-slider::-webkit-slider-thumb:hover {
    background: var(--primary-light);
    transform: scale(1.15);
    box-shadow: 0 0 6px rgba(31, 124, 236, 0.4);
}

#volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-base);
}

#volume-slider::-moz-range-thumb:hover {
    background: var(--primary-light);
    transform: scale(1.15);
    box-shadow: 0 0 6px rgba(31, 124, 236, 0.4);
}

.volume-value {
    font-size: 0.7rem;
    color: var(--text-muted);
    min-width: 30px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--spacing-xl);
    box-shadow: var(--shadow-inner);
    position: relative;
}

/* Progress milestone markers */
.progress-bar::before,
.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    width: 2px;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    z-index: 1;
}

.progress-bar::before {
    left: 50%;
}

.progress-bar::after {
    left: 75%;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    background-size: 200% 100%;
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
    position: relative;
    animation: progressShimmer 2s ease infinite;
}

@keyframes progressShimmer {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progressGleam 1.5s ease infinite;
}

@keyframes progressGleam {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.quiz-content {
    text-align: center;
}

.quiz-content h2 {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--spacing-xl);
    color: var(--text-primary);
}

.audio-controls {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    margin-bottom: var(--spacing-xl);
}

.answer-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.quiz-actions {
    margin-top: var(--spacing-lg);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: var(--font-family);
    position: relative;
    overflow: hidden;
}

/* Ripple effect */
.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

/* Focus states for accessibility */
.btn:focus {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}

.btn:focus:not(:focus-visible) {
    outline: none;
}

/* Disabled state */
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--glow-primary);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-light);
}

.btn-audio {
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    color: white;
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: var(--font-size-lg);
    box-shadow: var(--shadow-lg);
}

.btn-audio:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-xl), var(--glow-primary);
}

.btn-audio:active {
    transform: scale(0.98);
}

.btn-audio.playing {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: var(--shadow-lg), 0 0 0 0 rgba(31, 124, 236, 0.7);
    }
    50% {
        box-shadow: var(--shadow-xl), 0 0 0 10px rgba(31, 124, 236, 0);
    }
}

.btn-audio .icon {
    margin-right: var(--spacing-xs);
    display: inline-block;
    transition: transform var(--transition-base);
}

.btn-audio.playing .icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.btn-answer {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: var(--font-size-lg);
    min-height: 60px;
    transition: all var(--transition-base);

    /* Prevent Android tap highlight */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

@media (hover: hover) {
    .btn-answer:hover:not(:disabled) {
        background: var(--bg-tertiary);
        border-color: var(--primary-color);
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }
}

.btn-answer:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Remove focus outline on answer buttons */
.btn-answer:focus {
    outline: none;
}

.btn-answer:focus-visible {
    outline: none;
}

.btn-answer:active {
    outline: none;
}

/* Answer button states */
.btn-answer.selected {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md), var(--glow-primary);
}

.btn-answer.correct {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.1));
    border-color: var(--success-color);
    color: var(--success-color);
    box-shadow: var(--glow-success);
    animation: correctAnswer 0.5s ease;
}

.btn-answer.incorrect {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.1));
    border-color: var(--error-color);
    color: var(--error-color);
    box-shadow: var(--glow-error);
    animation: shake 0.5s ease;
}

@keyframes correctAnswer {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

.btn-hint {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-hint:hover {
    background: var(--bg-secondary);
    border-color: var(--warning-color);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
}

.btn-quit {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: var(--font-size-sm);
}

.btn-quit:hover {
    background: var(--error-color);
    border-color: var(--error-color);
    color: white;
}

/* ============================================
   Results Screen
   ============================================ */
.results-screen {
    text-align: center;
}

.results-screen h1 {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--spacing-xl);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.results-summary {
    background: var(--bg-secondary);
    padding: var(--spacing-xl);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    margin-bottom: var(--spacing-lg);
}

.score-circle {
    width: 200px;
    height: 200px;
    margin: 0 auto var(--spacing-lg);
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-2xl), var(--glow-primary);
    position: relative;
    animation: scoreAppear 0.6s ease;
}

@keyframes scoreAppear {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    60% {
        transform: scale(1.1) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.score-circle::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    z-index: -1;
    animation: rotate 3s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.score-value {
    font-size: var(--font-size-4xl);
    font-weight: bold;
    color: white;
    animation: countUp 1s ease;
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.score-label {
    font-size: var(--font-size-sm);
    color: rgba(255, 255, 255, 0.9);
    animation: fadeInUp 0.6s ease 0.3s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-details {
    display: flex;
    justify-content: center;
    gap: var(--spacing-xl);
    flex-wrap: wrap;
}

.result-item {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.result-item .label {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.result-item .value {
    color: var(--text-primary);
    font-size: var(--font-size-xl);
    font-weight: bold;
}

.results-actions {
    margin-top: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    align-items: center;
}

/* Share Buttons */
.share-buttons {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}

.landing-share {
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.results-share {
    order: -1; /* Show share buttons first */
    margin-bottom: var(--spacing-sm);
}

/* Modern Share Button Styling */
.btn-share-modern {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: var(--font-size-base);
    font-weight: 700;
    background: linear-gradient(135deg, #1f7cec 0%, #1565c0 50%, #0a284b 100%);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-xl);
    box-shadow:
        0 10px 25px -5px rgba(31, 124, 236, 0.5),
        0 8px 10px -6px rgba(31, 124, 236, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    min-width: 140px;
}

.btn-share-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.btn-share-modern:hover::before {
    left: 100%;
}

.btn-share-modern::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-share-modern:hover::after {
    opacity: 1;
}

.btn-share-modern:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow:
        0 20px 35px -5px rgba(31, 124, 236, 0.6),
        0 15px 20px -6px rgba(31, 124, 236, 0.5),
        0 0 40px rgba(31, 124, 236, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
}

.btn-share-modern:active {
    transform: translateY(-2px) scale(1.02);
}

.share-icon {
    width: 17px;
    height: 17px;
    stroke-width: 2.5;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    animation: shareIconPulse 2s ease-in-out infinite;
}

@keyframes shareIconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.btn-share-modern:hover .share-icon {
    animation: shareIconSpin 0.6s ease;
}

@keyframes shareIconSpin {
    0% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(180deg) scale(1.2);
    }
    100% {
        transform: rotate(360deg) scale(1);
    }
}

/* Challenge Button Variant */
.btn-share-modern.btn-challenge {
    background: linear-gradient(135deg, #0a284b 0%, #1565c0 50%, #1f7cec 100%);
    box-shadow:
        0 10px 25px -5px rgba(10, 40, 75, 0.5),
        0 8px 10px -6px rgba(10, 40, 75, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-share-modern.btn-challenge:hover {
    box-shadow:
        0 20px 35px -5px rgba(10, 40, 75, 0.6),
        0 15px 20px -6px rgba(10, 40, 75, 0.5),
        0 0 40px rgba(10, 40, 75, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Icon-only Share Button */
.btn-share-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    transition: all var(--transition-base);
    cursor: pointer;
}

.btn-share-icon:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(31, 124, 236, 0.3);
}

.btn-share-icon .share-icon {
    width: 18px;
    height: 18px;
    margin: 0;
}

/* Subtitle row with icon */
.subtitle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.subtitle-row .subtitle {
    margin: 0;
    flex: 1;
}

/* Score circle with icon */
.score-circle {
    position: relative;
}

.score-circle .btn-share-icon {
    position: absolute;
    top: 10px;
    right: 10px;
}

/* ============================================
   Modal (Hint/Cheat Sheet)
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border-radius: var(--radius-2xl);
    border: 1px solid var(--border-color);
    max-width: 900px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    z-index: 1001;
    box-shadow: var(--shadow-2xl);
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Custom scrollbar for modal */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-sm);
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: var(--font-size-2xl);
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: var(--font-size-3xl);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--spacing-lg);
}

.interval-description {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    font-size: var(--font-size-base);
    text-align: center;
}

/* Cheat Sheet Grid Layout */
.cheat-sheet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-sm);
    max-height: 60vh;
    overflow-y: auto;
    padding: var(--spacing-xs);
}

/* Custom scrollbar for cheat sheet grid */
.cheat-sheet-grid::-webkit-scrollbar {
    width: 8px;
}

.cheat-sheet-grid::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.cheat-sheet-grid::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-sm);
}

.cheat-sheet-grid::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

.interval-card {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    border-left: 3px solid var(--primary-color);
    transition: all var(--transition-base);
}

.interval-card:hover {
    background: rgba(31, 124, 236, 0.08);
    border-left-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.interval-card-header {
    font-weight: bold;
    color: var(--primary-light);
    font-size: var(--font-size-base);
    margin-bottom: var(--spacing-xs);
    padding-bottom: var(--spacing-xs);
    border-bottom: 1px solid var(--border-color);
}

.interval-name-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.interval-notation {
    width: 80px;
    height: 50px;
    flex-shrink: 0;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    padding: 4px;
}

.interval-card-examples {
    list-style: none;
    padding: 0;
    margin: 0;
}

.interval-card-examples li {
    padding: var(--spacing-xs) 0;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    line-height: 1.4;
}

.interval-card-examples li strong {
    color: var(--text-primary);
    font-weight: 500;
    display: block;
}

.interval-card-examples li .artist {
    color: var(--text-muted);
    font-size: 0.85em;
    font-style: italic;
}

/* ============================================
   Keyboard Shortcuts Indicator
   ============================================ */
.keyboard-shortcuts {
    position: fixed;
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    background: var(--bg-secondary);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xl);
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    opacity: 0.7;
    transition: all var(--transition-base);
    z-index: 100;
}

.keyboard-shortcuts:hover {
    opacity: 1;
    box-shadow: var(--shadow-2xl);
}

.keyboard-shortcuts kbd {
    display: inline-block;
    padding: 0.2rem 0.4rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 0.85em;
    color: var(--text-primary);
    margin: 0 0.2rem;
    box-shadow: var(--shadow-sm);
}

/* ============================================
   Loading States
   ============================================ */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

/* ============================================
   Celebration Overlay (for correct answers)
   ============================================ */
.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(16, 185, 129, 0.1);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    animation: celebrationPulse 1s ease;
    pointer-events: none;
}

.celebration-overlay.active {
    display: flex;
}

@keyframes celebrationPulse {
    0%, 100% {
        background: rgba(16, 185, 129, 0);
    }
    50% {
        background: rgba(16, 185, 129, 0.2);
    }
}

/* Wrong answer variant */
.celebration-overlay.wrong {
    background: rgba(239, 68, 68, 0.1);
    animation: wrongPulse 1s ease;
}

@keyframes wrongPulse {
    0%, 100% {
        background: rgba(239, 68, 68, 0);
    }
    50% {
        background: rgba(239, 68, 68, 0.25);
    }
}

.celebration-message {
    font-size: var(--font-size-4xl);
    font-weight: bold;
    color: var(--success-color);
    text-align: center;
    padding: var(--spacing-xl);
    background: var(--bg-secondary);
    border-radius: var(--radius-2xl);
    border: 3px solid var(--success-color);
    box-shadow: var(--shadow-2xl), var(--glow-success);
    animation: celebrationBounce 1s ease;
    max-width: 600px;
    white-space: pre-line;
    pointer-events: auto;
}

.celebration-overlay.wrong .celebration-message {
    color: #ef4444;
    border-color: #ef4444;
    box-shadow: var(--shadow-2xl), 0 0 30px rgba(239, 68, 68, 0.4);
    animation: wrongShake 0.6s ease;
    font-size: var(--font-size-2xl);
    line-height: 1.4;
}

.celebration-text {
    display: block;
    margin-top: var(--spacing-sm);
}

.overlay-buttons {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.btn-continue {
    padding: var(--spacing-md) var(--spacing-2xl);
    font-size: var(--font-size-lg);
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 4px 12px rgba(31, 124, 236, 0.3);
}

.btn-continue:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(31, 124, 236, 0.4);
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
}

.btn-continue:active {
    transform: translateY(0);
}

.btn-replay {
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: var(--font-size-lg);
    font-weight: 600;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-dark));
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 4px 12px rgba(10, 40, 75, 0.3);
}

.btn-replay:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(10, 40, 75, 0.4);
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary-color));
}

.btn-replay:active {
    transform: translateY(0);
}

.btn-replay.playing {
    animation: pulse 1.5s infinite;
}

@keyframes wrongShake {
    0%, 100% {
        transform: translateX(0) rotate(0deg);
        opacity: 1;
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-10px) rotate(-2deg);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(10px) rotate(2deg);
    }
}

@keyframes celebrationBounce {
    0% {
        transform: scale(0) rotate(-10deg);
        opacity: 0;
    }
    40% {
        transform: scale(1.3) rotate(5deg);
    }
    60% {
        transform: scale(0.95) rotate(-3deg);
    }
    80% {
        transform: scale(1.05) rotate(2deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.celebration-emoji {
    font-size: 3.5rem;
    display: block;
    margin-bottom: var(--spacing-sm);
    animation: emojiPop 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes emojiPop {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.4) rotate(10deg);
    }
    70% {
        transform: scale(0.9) rotate(-5deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes emojiRotate {
    0% {
        transform: rotate(0deg) scale(0);
    }
    50% {
        transform: rotate(180deg) scale(1.3);
    }
    100% {
        transform: rotate(360deg) scale(1);
    }
}

/* ============================================
   Confetti Animation (for results screen)
   ============================================ */
@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    position: absolute;
    animation: confetti-fall 3s linear;
}

/* ============================================
   Utility Classes
   ============================================ */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glow {
    box-shadow: var(--glow-primary);
}

.elevated {
    box-shadow: var(--shadow-xl);
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

.slide-in-left {
    animation: slideInLeft 0.4s ease;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.4s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   Mobile Leaderboard Ticker
   ============================================ */
.mobile-leaderboard-ticker {
    display: none; /* Hidden on desktop */
}

@media (max-width: 768px) {
    /* Logo adjustments for mobile */
    .app-header {
        gap: var(--spacing-md);
    }

    .app-logo {
        height: 95px;
    }

    .app-header h1 {
        font-size: var(--font-size-3xl);
    }

    /* Smaller share buttons on mobile */
    .btn-share-modern {
        padding: var(--spacing-xs) var(--spacing-md);
        font-size: var(--font-size-sm);
        min-width: 100px;
    }

    .btn-share-modern .share-icon {
        width: 14px;
        height: 14px;
    }

    /* Icon-only share button on mobile */
    .btn-share-icon {
        width: 36px;
        height: 36px;
    }

    .btn-share-icon .share-icon {
        width: 16px;
        height: 16px;
    }

    /* Celebration message on mobile */
    .celebration-message {
        max-width: 90%;
        font-size: var(--font-size-2xl);
        padding: var(--spacing-md);
    }

    .celebration-overlay.wrong .celebration-message {
        font-size: var(--font-size-lg);
    }

    .celebration-emoji {
        font-size: 2.5rem;
    }

    .overlay-buttons {
        gap: var(--spacing-sm);
        margin-top: var(--spacing-md);
    }

    .btn-continue,
    .btn-replay {
        padding: var(--spacing-sm) var(--spacing-lg);
        font-size: var(--font-size-base);
    }

    body {
        padding-top: 60px; /* Just ticker (60px) */
    }

    .mobile-leaderboard-ticker {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, rgba(31, 124, 236, 0.1), rgba(10, 40, 75, 0.08));
        backdrop-filter: blur(12px);
        padding: 0;
        z-index: 100;
        overflow: hidden;
        height: 60px;
        border-bottom: 2px solid rgba(31, 124, 236, 0.3);
        box-shadow:
            0 4px 12px rgba(0, 0, 0, 0.1),
            inset 0 1px 0 rgba(31, 124, 236, 0.1);
    }

    .mobile-leaderboard-ticker::before {
        content: '🏆 LEADERBOARD';
        position: absolute;
        top: 2px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 0.65rem;
        font-weight: 700;
        color: rgba(31, 124, 236, 0.9);
        letter-spacing: 1px;
        text-transform: uppercase;
        z-index: 1;
    }

    .ticker-content {
        display: flex;
        flex-direction: column;
        animation: scrollVertical 24s ease-in-out infinite;
        height: 100%;
        margin-top: 18px; /* Space for label */
    }

    .ticker-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: var(--spacing-sm);
        padding: var(--spacing-sm) var(--spacing-md);
        background: rgba(248, 250, 252, 0.8);
        border-radius: 0;
        font-size: var(--font-size-base);
        border: none;
        transition: all 0.3s ease;
        height: 42px;
        flex-shrink: 0;
        width: 100%;
    }

    .ticker-item.current-user {
        background: linear-gradient(90deg, rgba(31, 124, 236, 0.25), rgba(10, 40, 75, 0.15));
        border-left: 3px solid var(--primary-color);
        box-shadow:
            inset 0 0 20px rgba(31, 124, 236, 0.2),
            0 0 15px rgba(31, 124, 236, 0.3);
    }

    .ticker-item .rank {
        font-weight: bold;
        color: var(--primary-light);
        min-width: 28px;
        text-align: center;
        flex-shrink: 0;
    }

    .ticker-item .name {
        color: var(--text-primary);
        flex: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        font-weight: 600;
        white-space: nowrap;
        text-align: left;
    }

    .ticker-item .score {
        font-weight: bold;
        color: var(--primary-color);
        min-width: 50px;
        text-align: right;
        flex-shrink: 0;
        font-size: var(--font-size-lg);
    }

    .ticker-item.top-1 .rank {
        color: var(--gold);
    }

    .ticker-item.top-2 .rank {
        color: var(--silver);
    }

    .ticker-item.top-3 .rank {
        color: var(--bronze);
    }

    /* Vertical scroll with pauses - one user at a time */
    @keyframes scrollVertical {
        /* User 1 - pause */
        0%, 10% {
            transform: translateY(0);
        }
        /* Move to User 2 */
        12% {
            transform: translateY(-42px);
        }
        /* User 2 - pause */
        12.5%, 22.5% {
            transform: translateY(-42px);
        }
        /* Move to User 3 */
        24.5% {
            transform: translateY(-84px);
        }
        /* User 3 - pause */
        25%, 35% {
            transform: translateY(-84px);
        }
        /* Move to User 4 */
        37% {
            transform: translateY(-126px);
        }
        /* User 4 - pause */
        37.5%, 47.5% {
            transform: translateY(-126px);
        }
        /* Move to User 5 */
        49.5% {
            transform: translateY(-168px);
        }
        /* User 5 - pause */
        50%, 60% {
            transform: translateY(-168px);
        }
        /* Move to User 6 */
        62% {
            transform: translateY(-210px);
        }
        /* User 6 - pause */
        62.5%, 72.5% {
            transform: translateY(-210px);
        }
        /* Move to User 7 */
        74.5% {
            transform: translateY(-252px);
        }
        /* User 7 - pause */
        75%, 85% {
            transform: translateY(-252px);
        }
        /* Move to User 8 */
        87% {
            transform: translateY(-294px);
        }
        /* User 8 - pause */
        87.5%, 97.5% {
            transform: translateY(-294px);
        }
        /* Quick return to start for seamless loop */
        100% {
            transform: translateY(0);
        }
    }

    /* Add top padding to main content to account for fixed ticker */
    .main-content {
        padding-top: 60px;
    }
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1024px) {
    .leaderboard-panel {
        width: 240px;
    }
    
    .main-content {
        margin-left: 240px;
    }
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    /* Hide sidebar leaderboard on mobile */
    .leaderboard-panel {
        display: none;
    }

    .main-content {
        margin-left: 0;
    }

    .answer-options {
        grid-template-columns: 1fr;
    }

    .quiz-header {
        flex-direction: column;
        gap: var(--spacing-sm);
        align-items: flex-start;
    }

    .results-details {
        flex-direction: column;
        gap: var(--spacing-md);
    }
}

/* ============================================
   Certificate Modal & Styling
   ============================================ */

/* Certificate Button */
.btn-certificate {
    background: linear-gradient(135deg, #1a2e44 0%, #2d4a68 100%);
    color: #fff;
    font-weight: 700;
    font-size: var(--font-size-lg);
    padding: var(--spacing-md) var(--spacing-2xl);
    margin-bottom: var(--spacing-md);
    box-shadow:
        0 10px 25px -5px rgba(26, 46, 68, 0.5),
        0 8px 10px -6px rgba(26, 46, 68, 0.4);
    border: 2px solid #b8956a;
}

.btn-certificate:hover {
    background: linear-gradient(135deg, #2d4a68 0%, #1a2e44 100%);
    transform: translateY(-2px);
    box-shadow:
        0 15px 35px -5px rgba(26, 46, 68, 0.6),
        0 10px 15px -6px rgba(26, 46, 68, 0.5);
}

/* Certificate Modal */
.certificate-modal .modal-content {
    max-width: 900px;
    background: transparent;
    padding: var(--spacing-lg);
    border: none;
    box-shadow: none;
}

.certificate-content {
    padding: 0;
}

/* Certificate Container */
.certificate {
    background: #f5f1e8;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    border-radius: 0;
}

/* Certificate - Classical University Degree Style */
.certificate {
    background: linear-gradient(135deg, #f9f6f0 0%, #ebe6db 100%);
    padding: 20px;
}

.cert-ornate-border {
    border: 12px double #8b6f47;
    padding: 30px;
    background: #faf8f3;
    box-shadow: inset 0 0 30px rgba(139, 111, 71, 0.1);
    position: relative;
}

.cert-ornate-border::before,
.cert-ornate-border::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    border: 2px solid #8b6f47;
}

.cert-ornate-border::before {
    top: 10px;
    left: 10px;
    border-right: none;
    border-bottom: none;
}

.cert-ornate-border::after {
    bottom: 10px;
    right: 10px;
    border-left: none;
    border-top: none;
}

.cert-inner-border {
    border: 3px solid #b8956a;
    padding: 50px 60px;
    background: linear-gradient(to bottom, #fffcf7 0%, #faf8f3 100%);
    position: relative;
}

/* Header Section */
.cert-header {
    text-align: center;
    margin-bottom: 50px;
    position: relative;
}

.cert-emblem {
    height: 168px;
    width: auto;
    margin-bottom: 30px;
    filter: sepia(0.2);
}

.cert-flourish {
    height: 30px;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 30"><path d="M0,15 Q50,5 100,15 T200,15" stroke="%238b6f47" fill="none" stroke-width="1.5"/><path d="M0,15 Q50,25 100,15 T200,15" stroke="%238b6f47" fill="none" stroke-width="1.5"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin: 20px auto;
    width: 250px;
    opacity: 0.6;
}

.cert-institution {
    font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, 'Times New Roman', serif;
    font-size: 3.5rem;
    font-weight: 400;
    color: #2c1810;
    margin: 20px 0 15px 0;
    letter-spacing: 8px;
    text-transform: uppercase;
}

.cert-decree {
    font-family: 'Garamond', 'Baskerville', 'Times New Roman', serif;
    font-size: 2rem;
    font-style: italic;
    color: #5a4a3a;
    letter-spacing: 3px;
}

/* Body Section */
.cert-body {
    text-align: center;
    margin: 50px 0;
}

.cert-preamble {
    font-family: 'Garamond', 'Baskerville', 'Times New Roman', serif;
    font-size: 1.5rem;
    font-style: italic;
    color: #4a3a2a;
    margin-bottom: 30px;
}

.cert-recipient {
    font-family: 'Brush Script MT', 'Lucida Handwriting', cursive;
    font-size: 4.5rem;
    font-weight: 400;
    color: #1a1a1a;
    margin: 40px 0;
    border-bottom: 2px solid #8b6f47;
    display: inline-block;
    padding-bottom: 10px;
    line-height: 1.2;
}

.cert-text {
    font-family: 'Garamond', 'Baskerville', 'Times New Roman', serif;
    font-size: 1.4rem;
    color: #3a3a3a;
    line-height: 2.2;
    max-width: 650px;
    margin: 40px auto;
}

.cert-text em {
    font-style: italic;
    color: #2c1810;
}

/* Credentials */
.cert-credentials {
    display: flex;
    justify-content: center;
    gap: 80px;
    margin: 50px 0;
}

.cert-credential-item {
    text-align: center;
}

.cert-label {
    font-family: 'Garamond', 'Times New Roman', serif;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #6a5a4a;
    display: block;
    margin-bottom: 10px;
}

.cert-value {
    font-family: 'Garamond', 'Baskerville', 'Times New Roman', serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #2c1810;
}

/* Authentication Section */
.cert-authentication {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 60px;
    padding-top: 40px;
}

.cert-signature-block {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.cert-signature-script {
    font-family: 'Edwardian Script ITC', 'Kunstler Script', 'Brush Script MT', cursive;
    font-size: 3.5rem;
    color: #2c1810;
    margin-bottom: 8px;
    line-height: 1;
    font-weight: 400;
}

.cert-signature-underline {
    width: 240px;
    height: 1.5px;
    background: #2c1810;
    margin: 0 0 12px 0;
}

.cert-signature-title {
    font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
    font-size: 0.95rem;
    color: #2c1810;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}

.cert-website-link {
    font-family: 'Garamond', 'Times New Roman', serif;
    font-size: 0.85rem;
    color: #6a5a4a;
    margin-top: 6px;
    font-style: normal;
    letter-spacing: 0.5px;
}

/* Enhanced Wax Seal with Ribbons */
.cert-wax-seal {
    position: relative;
    margin-left: 40px;
}

.wax-seal-outer {
    width: 140px;
    height: 140px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 48% 52% 50% 50% / 52% 48% 52% 48%;
    background: radial-gradient(circle at 35% 30%,
        #e74c3c 0%,
        #c0392b 25%,
        #a93226 50%,
        #922b21 75%,
        #7b241c 100%);
    box-shadow:
        0 8px 25px rgba(139, 21, 32, 0.6),
        inset -5px -5px 15px rgba(0, 0, 0, 0.5),
        inset 4px 4px 12px rgba(232, 76, 61, 0.4),
        0 0 0 3px rgba(139, 21, 32, 0.3);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.wax-seal-outer::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.6) 0%, transparent 70%);
    filter: blur(12px);
}

.wax-seal-outer::after {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: 48% 52% 50% 50% / 52% 48% 52% 48%;
    background: radial-gradient(circle at center,
        rgba(139, 21, 32, 0.6) 0%,
        rgba(139, 21, 32, 0.4) 50%,
        transparent 100%);
    border: 2px solid rgba(0, 0, 0, 0.2);
}

.wax-seal-inner {
    text-align: center;
    z-index: 2;
    position: relative;
}

.wax-seal-symbol {
    display: none;
}

.wax-seal-text {
    font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    text-transform: uppercase;
    letter-spacing: 2px;
    line-height: 1.4;
    text-shadow:
        1px 1px 2px rgba(0, 0, 0, 0.8),
        0 0 4px rgba(0, 0, 0, 0.5);
}

/* Wax Seal Ribbons */
.wax-seal-ribbon {
    position: absolute;
    width: 30px;
    height: 70px;
    top: 100px;
    background: linear-gradient(to bottom,
        #c0392b 0%,
        #a93226 40%,
        #922b21 70%,
        #7b241c 100%);
    box-shadow:
        inset 2px 0 4px rgba(255, 255, 255, 0.2),
        inset -2px 0 4px rgba(0, 0, 0, 0.4),
        2px 4px 8px rgba(0, 0, 0, 0.4);
    clip-path: polygon(0 0, 100% 0, 100% 80%, 50% 100%, 0 80%);
    z-index: 1;
}

.wax-seal-ribbon.left {
    left: 25px;
    transform: rotate(-15deg);
}

.wax-seal-ribbon.right {
    right: 25px;
    transform: rotate(15deg);
}

/* Print Styles */
@media print {
    body * {
        visibility: hidden;
    }

    .certificate, .certificate * {
        visibility: visible;
    }

    .certificate {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }

    .modal-close {
        display: none !important;
    }
}

/* Mobile Responsiveness for Certificate */
@media (max-width: 768px) {
    .certificate-modal .modal-content {
        max-width: 100%;
        width: 98%;
        max-height: 95vh;
        padding: 0;
    }

    .certificate {
        padding: 10px;
    }

    .cert-ornate-border {
        border-width: 6px;
        padding: 15px;
    }

    .cert-ornate-border::before,
    .cert-ornate-border::after {
        width: 25px;
        height: 25px;
    }

    .cert-inner-border {
        padding: 30px 20px;
    }

    .cert-emblem {
        height: 120px;
        margin-bottom: 20px;
    }

    .cert-flourish {
        width: 150px;
        height: 20px;
        margin: 15px auto;
    }

    .cert-institution {
        font-size: 2rem;
        letter-spacing: 4px;
    }

    .cert-decree {
        font-size: 1.3rem;
        letter-spacing: 2px;
    }

    .cert-body {
        margin: 30px 0;
    }

    .cert-preamble {
        font-size: 1.1rem;
        margin-bottom: 20px;
    }

    .cert-recipient {
        font-size: 2.5rem;
        margin: 25px 0;
        padding-bottom: 8px;
    }

    .cert-text {
        font-size: 1.1rem;
        line-height: 1.9;
        margin: 25px auto;
    }

    .cert-credentials {
        flex-direction: column;
        gap: 20px;
        margin: 30px 0;
    }

    .cert-label {
        font-size: 0.85rem;
    }

    .cert-value {
        font-size: 1.3rem;
    }

    .cert-authentication {
        flex-direction: column;
        align-items: center;
        gap: 30px;
        margin-top: 40px;
        padding-top: 30px;
    }

    .cert-signature-block {
        align-items: center;
        text-align: center;
    }

    .cert-signature-script {
        font-size: 2.8rem;
    }

    .cert-signature-underline {
        width: 180px;
        margin: 0 0 10px 0;
    }

    .cert-signature-title {
        font-size: 0.85rem;
    }

    .cert-website-link {
        font-size: 0.75rem;
    }

    .cert-wax-seal {
        margin-left: 0;
    }

    .wax-seal-outer {
        width: 110px;
        height: 110px;
    }

    .wax-seal-text {
        font-size: 0.6rem;
        letter-spacing: 1.5px;
    }

    .wax-seal-ribbon {
        width: 25px;
        height: 55px;
        top: 80px;
    }

    .wax-seal-ribbon.left {
        left: 20px;
    }

    .wax-seal-ribbon.right {
        right: 20px;
    }
}



