/* QuizCraft - Custom Styles */
/* Enhanced Design by Senior UI Designer */

/* ===================================
   CSS CUSTOM PROPERTIES
   =================================== */

:root {
    /* Primary Palette */
    --primary: #7c3aed;
    --primary-dark: #6d28d9;
    --primary-light: #a78bfa;
    --primary-bg: #f5f3ff;
    --primary-glow: rgba(124, 58, 237, 0.15);

    /* Neutral Palette */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Accent Colors */
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --error: #ef4444;
    --error-light: #fee2e2;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-primary: 0 4px 14px 0 rgba(124, 58, 237, 0.25);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Border Radius */
    --radius-sm: 4px;
    --radius: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

/* ===================================
   GENERAL STYLES
   =================================== */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===================================
   ACCESSIBILITY ENHANCEMENTS
   =================================== */

/* Enhanced focus styles for accessibility - WCAG 2.1 AA compliant */
:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

/* Focus visible ring utility class */
.focus-visible-ring:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Skip link for keyboard navigation */
.skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    background: var(--primary);
    color: white;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-weight: 600;
    z-index: 9999;
    text-decoration: none;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 16px;
    outline: 3px solid var(--primary-dark);
    outline-offset: 2px;
}

/* Screen reader only utility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Dyslexic-friendly font mode */
body.dyslexic-font {
    font-family: 'Lexend', 'OpenDyslexic', Arial, sans-serif;
    letter-spacing: 0.05em;
    word-spacing: 0.1em;
}

body.dyslexic-font * {
    line-height: 1.8 !important;
}

body.dyslexic-font p,
body.dyslexic-font li,
body.dyslexic-font label,
body.dyslexic-font span {
    letter-spacing: 0.05em;
    word-spacing: 0.15em;
}

/* High contrast mode for low vision users */
body.high-contrast {
    --gray-500: #333;
    --gray-600: #000;
    --gray-400: #333;
}

body.high-contrast .text-gray-500,
body.high-contrast .text-gray-600,
body.high-contrast .text-gray-400 {
    color: #000 !important;
}

body.high-contrast a:not(.bg-primary):not(.text-white),
body.high-contrast button:not(.bg-primary):not([disabled]) {
    text-decoration: underline;
    text-underline-offset: 2px;
}

body.high-contrast .border-gray-200,
body.high-contrast .border-gray-300 {
    border-color: #000 !important;
    border-width: 2px !important;
}

body.high-contrast input,
body.high-contrast textarea {
    border-color: #000 !important;
    border-width: 2px !important;
}

body.high-contrast .format-card {
    border-width: 3px !important;
}

body.high-contrast .quiz-format-option input:checked + .format-card {
    border-width: 4px !important;
}

/* Reduce motion mode */
body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
}

/* Accessibility settings panel */
#a11y-panel {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

#a11y-panel label {
    cursor: pointer;
    padding: 8px 0;
}

/* Improved color contrast for text - WCAG AA minimum 4.5:1 */
.text-gray-500 {
    color: #525252 !important; /* Darker for better contrast */
}

.text-gray-600 {
    color: #374151 !important; /* Ensure 4.5:1 contrast ratio */
}

/* Selection color */
::selection {
    background: var(--primary-light);
    color: white;
}

/* ===================================
   LOGO ANIMATION
   =================================== */

.logo-text {
    display: inline-block;
    transition: transform var(--transition-normal);
}

.logo-text:hover {
    transform: scale(1.02);
}

/* ===================================
   QUIZ FORMAT SELECTOR - ENHANCED
   =================================== */

.quiz-format-option {
    display: block;
}

.format-card {
    position: relative;
    background: white;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    overflow: hidden;
}

.format-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: transparent;
    transition: background var(--transition-normal);
}

.format-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.format-card:active {
    transform: translateY(0);
}

/* Format Card Icon Container */
.format-card .format-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
}

.format-card:hover .format-icon {
    transform: scale(1.1);
}

/* Selected State */
.quiz-format-option input:checked + .format-card {
    border-color: var(--primary);
    background: linear-gradient(to bottom, var(--primary-bg), white);
    box-shadow: var(--shadow-primary);
}

.quiz-format-option input:checked + .format-card::before {
    background: var(--primary);
}

.quiz-format-option input:checked + .format-card .format-icon {
    background: var(--primary);
    color: white;
}

/* Checkmark Badge */
.quiz-format-option input:checked + .format-card::after {
    content: '';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 22px;
    height: 22px;
    background: var(--primary);
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z'/%3E%3C/svg%3E");
    background-size: 14px;
    background-position: center;
    background-repeat: no-repeat;
    animation: popIn var(--transition-bounce);
}

@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ===================================
   PREVIEW PANE - PAPER EFFECT
   =================================== */

#previewPane {
    position: relative;
    background: linear-gradient(to bottom, #ffffff 0%, #fafafa 100%);
    border-radius: var(--radius);
    box-shadow:
        0 1px 1px rgba(0,0,0,0.05),
        0 2px 2px rgba(0,0,0,0.05),
        0 4px 4px rgba(0,0,0,0.05),
        0 8px 8px rgba(0,0,0,0.05);
    overflow: hidden;
}

/* Paper texture overlay */
#previewPane::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.015;
    pointer-events: none;
    z-index: 1;
}

/* Paper edge shadow */
#previewPane::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(0,0,0,0.02));
    pointer-events: none;
}

/* Empty State */
.preview-empty {
    text-align: center;
    padding: 60px 20px;
}

.preview-empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: var(--gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: float 3s ease-in-out infinite;
}

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

.preview-empty-icon svg {
    width: 40px;
    height: 40px;
    color: var(--gray-400);
}

/* ===================================
   QUIZ PREVIEW STYLES - PROFESSIONAL
   =================================== */

.quiz-preview {
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.7;
    color: var(--gray-900);
    position: relative;
    z-index: 2;
    animation: fadeInUp var(--transition-slow) ease-out;
}

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

.quiz-preview h1 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 26px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 6px;
    letter-spacing: -0.025em;
    color: var(--gray-900);
}

/* Quiz Header with Score Box */
.quiz-header {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--gray-900);
    position: relative;
}

.quiz-header::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gray-300);
}

.quiz-score-box {
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    border: 2px solid var(--gray-400);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
}

.quiz-score-box .score-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gray-500);
    font-weight: 600;
}

.quiz-score-box .score-line {
    width: 50px;
    border-bottom: 1px solid var(--gray-900);
    margin: 8px 0 4px;
}

.quiz-score-box .score-total {
    font-size: 12px;
    color: var(--gray-600);
}

/* Quiz Meta Information */
.quiz-preview .quiz-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 20px;
    padding-right: 100px;
}

.quiz-preview .quiz-meta-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.quiz-preview .quiz-meta-label {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 13px;
    color: var(--gray-700);
}

.quiz-preview .quiz-meta-value {
    border-bottom: 1px solid var(--gray-900);
    min-width: 140px;
    padding-bottom: 2px;
    font-size: 14px;
}

/* Instructions Box */
.quiz-preview .instructions {
    margin-bottom: 28px;
    padding: 16px 20px;
    background: linear-gradient(to right, var(--gray-50), white);
    border-left: 4px solid var(--primary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 14px;
    color: var(--gray-700);
}

.quiz-preview .instructions strong {
    font-family: 'Inter', sans-serif;
    color: var(--gray-900);
    display: inline-block;
    margin-right: 6px;
}

/* Point Value Badge */
.point-value {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--gray-100);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: var(--gray-600);
    margin-left: 8px;
}

/* ===================================
   MATCHING QUIZ STYLES
   =================================== */

.matching-quiz {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.matching-column {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 20px;
}

.matching-column h3 {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-600);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gray-100);
}

.matching-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
    padding: 10px 12px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.matching-item:hover {
    background: var(--primary-bg);
}

.matching-number,
.matching-letter {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    min-width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-200);
    border-radius: 50%;
    font-size: 13px;
    color: var(--gray-700);
    flex-shrink: 0;
}

.matching-answer-blank {
    width: 36px;
    height: 28px;
    border: 1.5px solid var(--gray-400);
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: white;
    flex-shrink: 0;
}

.matching-term,
.matching-definition {
    line-height: 1.5;
    padding-top: 3px;
}

/* ===================================
   FILL IN BLANK STYLES
   =================================== */

.fillblank-quiz .question {
    margin-bottom: 28px;
    padding-left: 48px;
    position: relative;
}

.fillblank-quiz .question-number {
    position: absolute;
    left: 0;
    top: 0;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    width: 32px;
    height: 32px;
    background: var(--gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--gray-700);
}

.fillblank-quiz .definition {
    margin-bottom: 12px;
    padding: 12px 16px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--gray-300);
}

.fillblank-quiz .answer-line {
    display: block;
    margin-top: 8px;
    padding: 8px 0;
    border-bottom: 2px solid var(--gray-400);
    min-height: 32px;
    position: relative;
}

.fillblank-quiz .answer-line::before {
    content: 'Answer:';
    position: absolute;
    left: 0;
    top: -20px;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
}

/* Word Bank - Enhanced */
.word-bank {
    margin-top: 40px;
    padding: 24px;
    border: 2px dashed var(--primary);
    background: linear-gradient(135deg, var(--primary-bg) 0%, white 100%);
    border-radius: var(--radius-md);
    position: relative;
}

.word-bank::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 20px;
    right: 20px;
    height: 2px;
    background: white;
}

.word-bank h3 {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 16px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.word-bank h3::before {
    content: '';
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: var(--radius-sm);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-1 9h-4v4h-2v-4H9V9h4V5h2v4h4v2z'/%3E%3C/svg%3E");
    background-size: 14px;
    background-position: center;
    background-repeat: no-repeat;
}

.word-bank-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.word-bank-item {
    background: white;
    padding: 10px 18px;
    border: 1px solid var(--gray-200);
    border-radius: 100px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: var(--gray-800);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.word-bank-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

/* ===================================
   MULTIPLE CHOICE STYLES
   =================================== */

.multiplechoice-quiz .question {
    margin-bottom: 32px;
    padding: 20px;
    background: var(--gray-50);
    border-radius: var(--radius);
    border: 1px solid var(--gray-100);
    transition: all var(--transition-fast);
}

.multiplechoice-quiz .question:hover {
    border-color: var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.multiplechoice-quiz .question-text {
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
}

.multiplechoice-quiz .question-number {
    min-width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.multiplechoice-quiz .options {
    padding-left: 44px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.multiplechoice-quiz .option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
    transition: all var(--transition-fast);
    cursor: default;
}

.multiplechoice-quiz .option:hover {
    border-color: var(--primary-light);
    background: var(--primary-bg);
}

.multiplechoice-quiz .option-circle {
    width: 22px;
    height: 22px;
    border: 2px solid var(--gray-400);
    border-radius: 50%;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.multiplechoice-quiz .option:hover .option-circle {
    border-color: var(--primary);
}

.multiplechoice-quiz .option-letter {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    min-width: 24px;
    color: var(--gray-600);
}

.multiplechoice-quiz .option-text {
    font-family: 'Georgia', serif;
    line-height: 1.5;
}

/* ===================================
   ANSWER KEY STYLES
   =================================== */

.answer-key {
    font-family: 'Inter', -apple-system, sans-serif;
    padding: 20px;
}

.answer-key h1 {
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    color: var(--gray-900);
}

.answer-key .answer-key-subtitle {
    text-align: center;
    color: var(--primary);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 24px;
}

.answer-key .answer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.answer-key .answer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary);
}

.answer-key .answer-number {
    font-weight: 700;
    min-width: 28px;
    height: 28px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.answer-key .answer-text {
    color: var(--primary);
    font-weight: 700;
    font-size: 15px;
}

.answer-key .answer-term {
    color: var(--gray-500);
    font-size: 13px;
    margin-left: auto;
}

/* ===================================
   GENERATE BUTTON - ENHANCED
   =================================== */

.generate-btn {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.generate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left var(--transition-slow);
}

.generate-btn:hover::before {
    left: 100%;
}

.generate-btn .btn-icon {
    width: 24px;
    height: 24px;
    transition: transform var(--transition-normal);
}

.generate-btn:hover .btn-icon {
    transform: rotate(180deg);
}

/* ===================================
   PRINT BUTTONS - ENHANCED
   =================================== */

.print-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition-normal);
}

.print-btn:not(:disabled):hover {
    background: var(--primary-bg);
    border-color: var(--primary);
    color: var(--primary);
}

.print-btn svg {
    width: 18px;
    height: 18px;
}

/* ===================================
   LOADING STATE - ENHANCED
   =================================== */

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 10;
    border-radius: var(--radius);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    color: var(--gray-600);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Loading dots animation */
.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* ===================================
   SUCCESS ANIMATION
   =================================== */

.success-flash {
    animation: successFlash var(--transition-slow);
}

@keyframes successFlash {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ===================================
   ERROR & SUCCESS MESSAGES
   =================================== */

.error-message {
    background: var(--error-light);
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.error-message::before {
    content: '';
    width: 24px;
    height: 24px;
    background: #b91c1c;
    border-radius: 50%;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z'/%3E%3C/svg%3E");
    background-size: 24px;
}

.success-message {
    background: var(--success-light);
    border: 1px solid #a7f3d0;
    color: #047857;
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideDown var(--transition-normal) ease-out;
}

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

.success-message::before {
    content: '';
    width: 24px;
    height: 24px;
    background: #047857;
    border-radius: 50%;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z'/%3E%3C/svg%3E");
    background-size: 16px;
    background-position: center;
    background-repeat: no-repeat;
}

/* ===================================
   INPUT ENHANCEMENTS
   =================================== */

textarea:focus,
input[type="text"]:focus {
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Textarea with line numbers effect */
#vocabularyInput {
    background:
        linear-gradient(90deg, var(--gray-100) 40px, transparent 40px),
        linear-gradient(var(--gray-100) 1px, transparent 1px);
    background-size: 100% 100%, 100% 26px;
    line-height: 26px;
    padding-left: 50px;
}

/* ===================================
   CHECKBOX ENHANCEMENTS
   =================================== */

input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-sm);
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
}

input[type="checkbox"]:hover {
    border-color: var(--primary);
}

input[type="checkbox"]:checked {
    background: var(--primary);
    border-color: var(--primary);
}

input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* ===================================
   TOOLTIP
   =================================== */

[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    background: var(--gray-900);
    color: white;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    z-index: 100;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-8px);
}

/* ===================================
   PRINT STYLES
   =================================== */

@media print {
    /* Hide everything except print container */
    body * {
        visibility: hidden;
    }

    #printContainer,
    #printContainer * {
        visibility: visible;
    }

    #printContainer {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }

    /* Page setup */
    @page {
        size: letter;
        margin: 0.75in;
    }

    /* ACCESSIBILITY: Ensure print is readable for all users */
    /* Use high contrast black text on white background */
    /* Minimum 12pt font for body text (dyslexia-friendly) */
    /* Clear structure with adequate spacing */

    /* Typography for print - accessible font sizes */
    .quiz-preview,
    .answer-key {
        font-size: 12pt; /* Larger for accessibility */
        line-height: 1.8; /* Increased line height for readability */
        color: #000;
        letter-spacing: 0.01em; /* Slight letter spacing for clarity */
    }

    /* Dyslexic-friendly print option */
    body.dyslexic-font .quiz-preview,
    body.dyslexic-font .answer-key {
        font-family: 'Lexend', 'OpenDyslexic', Arial, sans-serif !important;
        font-size: 13pt;
        line-height: 2;
        letter-spacing: 0.03em;
        word-spacing: 0.1em;
    }

    .quiz-preview h1,
    .answer-key h1 {
        font-size: 16pt;
        margin-bottom: 12pt;
    }

    /* Clean print appearance */
    .quiz-preview .quiz-meta {
        padding-right: 90px;
    }

    .quiz-score-box {
        border: 1pt solid #000;
    }

    .quiz-preview .instructions {
        background: #f5f5f5 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        border-left: 3pt solid #7c3aed;
        padding: 10pt 14pt;
    }

    /* Matching quiz print */
    .matching-column {
        border: 1pt solid #ccc !important;
        padding: 14pt;
    }

    .matching-item {
        background: transparent !important;
        padding: 6pt 0;
        border-bottom: 0.5pt dotted #ccc;
    }

    .matching-number,
    .matching-letter {
        background: #eee !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .matching-answer-blank {
        border: 1pt solid #000;
        width: 30pt;
        height: 24pt;
    }

    /* Fill blank print */
    .fillblank-quiz .question-number {
        background: #eee !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .fillblank-quiz .definition {
        background: #f9f9f9 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        border-left: 2pt solid #999;
    }

    .fillblank-quiz .answer-line {
        border-bottom: 1.5pt solid #000;
        margin-top: 6pt;
    }

    .fillblank-quiz .answer-line::before {
        display: none;
    }

    /* Word bank print */
    .word-bank {
        border: 1.5pt dashed #7c3aed !important;
        background: #f5f3ff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        padding: 14pt;
    }

    .word-bank h3 {
        color: #7c3aed !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .word-bank-item {
        background: white !important;
        border: 0.5pt solid #ddd;
        padding: 4pt 10pt;
        box-shadow: none !important;
    }

    /* Multiple choice print */
    .multiplechoice-quiz .question {
        background: transparent !important;
        border: none;
        padding: 0;
        margin-bottom: 18pt;
        page-break-inside: avoid;
    }

    .multiplechoice-quiz .question-number {
        background: #7c3aed !important;
        color: white !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .multiplechoice-quiz .option {
        background: transparent !important;
        border: none;
        padding: 4pt 0;
    }

    .multiplechoice-quiz .option-circle {
        border: 1.5pt solid #000;
        width: 14pt;
        height: 14pt;
    }

    /* Answer key print */
    .answer-key .answer-item {
        background: #f9f9f9 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        border-left: 2pt solid #7c3aed;
        padding: 8pt 12pt;
    }

    .answer-key .answer-number {
        background: #7c3aed !important;
        color: white !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        width: 20pt;
        height: 20pt;
        font-size: 10pt;
    }

    .answer-key .answer-text {
        color: #7c3aed !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Page breaks */
    .question,
    .matching-item,
    .answer-item {
        page-break-inside: avoid;
    }

    h1, h2, h3 {
        page-break-after: avoid;
    }

    /* Hide interactive elements */
    button,
    input,
    textarea,
    nav,
    footer,
    .no-print {
        display: none !important;
    }
}

/* Print-only content */
.print-only {
    display: none;
}

@media print {
    .print-only {
        display: block;
    }
}

/* ===================================
   RESPONSIVE STYLES
   =================================== */

/* ===================================
   MOBILE-FIRST RESPONSIVE STYLES
   =================================== */

/* Extra small devices (phones, 480px and down) */
@media (max-width: 480px) {
    /* Improve touch targets */
    .format-card {
        min-height: 100px;
        padding: 16px 12px;
    }

    /* Larger tap areas for format cards */
    .format-card .text-2xl {
        font-size: 2rem;
    }

    /* Stack quiz meta vertically */
    .quiz-preview .quiz-meta {
        flex-direction: column;
        gap: 16px;
        padding-right: 0;
    }

    /* Full width meta items on mobile */
    .quiz-preview .quiz-meta-item {
        flex-direction: column;
        gap: 4px;
    }

    .quiz-preview .quiz-meta-value {
        min-width: 100%;
    }

    /* Improve word bank readability */
    .word-bank-items {
        gap: 8px;
    }

    .word-bank-item {
        padding: 8px 14px;
        font-size: 13px;
    }

    /* Stack matching columns */
    .matching-quiz {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Improve multiple choice option spacing */
    .multiplechoice-quiz .options {
        padding-left: 0;
        gap: 10px;
    }

    .multiplechoice-quiz .option {
        padding: 14px;
    }

    /* Make answer key more compact */
    .answer-key .answer-item {
        padding: 10px 12px;
    }

    /* Improve quiz preview header */
    .quiz-preview h1 {
        font-size: 20px;
        padding-right: 0;
    }

    .quiz-score-box {
        position: static;
        margin: 16px auto 0;
        width: 70px;
        height: 70px;
    }

    /* Instructions box */
    .quiz-preview .instructions {
        padding: 12px 14px;
        font-size: 13px;
    }

    /* Fill blank adjustments */
    .fillblank-quiz .question {
        padding-left: 40px;
    }

    .fillblank-quiz .question-number {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}

/* Small devices (phones and small tablets, 768px and down) */
@media (max-width: 768px) {
    .matching-quiz {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .quiz-preview .quiz-meta {
        flex-direction: column;
        gap: 12px;
        padding-right: 0;
    }

    .quiz-score-box {
        position: static;
        margin: 16px auto 0;
    }

    .multiplechoice-quiz .options {
        padding-left: 0;
    }

    .answer-key .answer-grid {
        grid-template-columns: 1fr;
    }

    /* Mobile touch optimizations */
    button,
    .format-card,
    input[type="checkbox"],
    input[type="radio"],
    a.mobile-nav-link {
        -webkit-tap-highlight-color: transparent;
    }

    /* Prevent text selection on buttons */
    button {
        -webkit-user-select: none;
        user-select: none;
    }

    /* Smooth scrolling in preview pane */
    #previewPane {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }

    /* Better textarea experience on mobile */
    #vocabularyInput {
        font-size: 16px; /* Prevents zoom on iOS */
        padding-left: 16px;
        background: none;
    }

    /* Improve input field tap areas */
    input[type="text"] {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Tablet devices (768px to 1024px) - iPad optimization */
@media (min-width: 768px) and (max-width: 1024px) {
    /* Better spacing for iPad landscape */
    .matching-quiz {
        gap: 30px;
    }

    /* Larger format cards for easier tapping */
    .format-card {
        padding: 20px;
        min-height: 120px;
    }

    /* Better quiz preview for tablet */
    #previewPane {
        min-height: 600px;
    }

    /* Larger print buttons for tablet */
    #printQuizBtn,
    #printAnswerBtn {
        padding: 12px 20px;
        font-size: 15px;
        min-height: 48px;
    }

    /* Larger generate button for tablet */
    #generateBtn {
        min-height: 56px;
        font-size: 18px;
    }
}

/* Mobile landscape orientation */
@media (max-width: 768px) and (orientation: landscape) {
    /* Reduce vertical spacing in landscape */
    section {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }

    /* Make preview pane taller to show more content */
    #previewPane {
        min-height: 400px;
    }
}

/* Safe area insets for notched phones (iPhone X+) */
@supports (padding: max(0px)) {
    nav {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    footer {
        padding-bottom: max(3rem, env(safe-area-inset-bottom));
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===================================
   SECTION DIVIDERS
   =================================== */

.section-step {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.section-step-number {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.section-step-title {
    font-weight: 600;
    color: var(--gray-900);
    font-size: 16px;
}

/* ===================================
   FEATURE CARDS HOVER
   =================================== */

.feature-card {
    transition: all var(--transition-normal);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-card:hover .feature-icon {
    transform: scale(1.1);
}

.feature-icon {
    transition: transform var(--transition-normal);
}

/* ===================================
   CONFETTI EFFECT (for celebrations)
   =================================== */

@keyframes confetti-fall {
    0% { transform: translateY(-100%) rotate(0deg); }
    100% { transform: translateY(100vh) rotate(720deg); }
}

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--primary);
    animation: confetti-fall 3s ease-in-out forwards;
    z-index: 1000;
    pointer-events: none;
}

/* ===================================
   TEACHER-FRIENDLY TOUCHES & FUN STUFF
   =================================== */

/* Easter egg mode - activated via Konami code */
.teacher-mode-active {
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%) !important;
}

/* Fun hover effect for the generate button */
#generateBtn {
    position: relative;
    overflow: hidden;
}

#generateBtn::after {
    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.5s ease;
}

#generateBtn:hover::after {
    left: 100%;
}

/* Secret message for those who inspect */
/* Hey teacher! You found the secret CSS comment. */
/* You're the real MVP. Thanks for educating our future! */
/* Easter egg: The mitochondria is the powerhouse of the cell. */

/* Keyboard shortcut hint styling */
.keyboard-hint {
    display: inline-block;
    background: var(--gray-100);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 11px;
    color: var(--gray-600);
    border: 1px solid var(--gray-200);
    box-shadow: 0 1px 0 var(--gray-300);
}

/* "Made with love" footer styling */
#footer-easter-egg {
    transition: all 0.3s ease;
}

#footer-easter-egg:hover {
    color: var(--primary-light);
}

/* Encouraging pulse for empty states */
@keyframes encouragingPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Fun loading messages */
.loading-fun-message {
    color: var(--gray-500);
    font-size: 13px;
    text-align: center;
    font-style: italic;
}

/* ===================================
   ORGANIC GROWTH - COMMUNITY SECTION
   =================================== */

#community {
    position: relative;
    overflow: hidden;
}

/* Decorative background elements */
#community::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

/* Email form styling */
#leadMagnetForm input:focus,
#leadMagnetForm select:focus {
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.2);
}

/* Animated pulse for "Join X educators" badge */
#community .animate-pulse {
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
}

/* ===================================
   TEMPLATE CARDS - SEO SECTION
   =================================== */

#templates .sample-template-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all var(--transition-fast);
}

#templates .sample-template-btn:hover {
    transform: translateX(4px);
}

#templates .sample-template-btn:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Template card hover effects */
#templates > div > div.grid > div {
    transition: all var(--transition-normal);
}

#templates > div > div.grid > div:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* ===================================
   QUIZ IDEAS SEASONAL SECTION
   =================================== */

#quiz-ideas article {
    transition: all var(--transition-normal);
}

#quiz-ideas article:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

#quiz-ideas article ul li {
    position: relative;
    padding-left: 16px;
}

#quiz-ideas article ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.4;
}

/* ===================================
   EXPANDED FAQ STYLES
   =================================== */

#faq .space-y-4 > div {
    transition: all var(--transition-normal);
}

#faq article {
    transition: all var(--transition-fast);
}

#faq article:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

#faq h4 {
    color: var(--gray-900);
}

#faq h4::before {
    content: 'Q: ';
    color: var(--primary);
    font-weight: 700;
}

/* ===================================
   SHARE MODAL STYLES
   =================================== */

#shareModal {
    backdrop-filter: blur(4px);
}

#shareModal > div {
    animation: modal-slide-in 0.3s ease-out;
}

@keyframes modal-slide-in {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Social share buttons */
#shareModal button[id^="share"] {
    transition: all var(--transition-fast);
}

#shareModal button[id^="share"]:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

#shareModal button[id^="share"]:active {
    transform: translateY(0);
}

/* Copy link button feedback */
#copyShareLink.copied,
#copyTeacherMessage.copied {
    background: var(--success);
}

/* Teacher group message box */
#teacherGroupMessage {
    border-left: 3px solid var(--primary);
    position: relative;
}

#teacherGroupMessage::before {
    content: '"';
    position: absolute;
    top: -5px;
    left: 8px;
    font-size: 32px;
    color: var(--primary);
    opacity: 0.3;
    font-family: Georgia, serif;
}

/* ===================================
   PRINT WATERMARK - Made with QuizCraft
   =================================== */

.print-watermark {
    margin-top: 30px;
    padding-top: 15px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    color: var(--gray-400);
}

.print-watermark img {
    opacity: 0.8;
}

@media print {
    .print-watermark {
        display: flex !important;
        visibility: visible !important;
    }

    .print-watermark img {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* Hide watermark for Pro users - controlled via JS */
body.quizcraft-pro .print-watermark {
    display: none !important;
}

/* ===================================
   LEAD MAGNET SUCCESS STATE
   =================================== */

#leadMagnetForm .text-green-500 {
    color: var(--success);
}

/* Success animation for form submission */
@keyframes form-success {
    0% { transform: scale(0.9); opacity: 0; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

#leadMagnetForm .text-center {
    animation: form-success 0.5s ease-out;
}

/* ===================================
   TEACHER OF THE WEEK PLACEHOLDER
   =================================== */

#community .text-center > div.bg-white\/10 {
    transition: all var(--transition-normal);
}

#community .text-center > div.bg-white\/10:hover {
    transform: scale(1.02);
    background: rgba(255, 255, 255, 0.15);
}

/* ===================================
   TPT (Teachers Pay Teachers) LINK
   =================================== */

a[href*="teacherspayteachers"] {
    transition: all var(--transition-fast);
}

a[href*="teacherspayteachers"]:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ===================================
   RESPONSIVE ADJUSTMENTS FOR NEW SECTIONS
   =================================== */

@media (max-width: 768px) {
    /* Community section */
    #community .grid {
        gap: 32px;
    }

    #community .lg\\:grid-cols-2 {
        grid-template-columns: 1fr;
    }

    /* Template cards */
    #templates .grid {
        grid-template-columns: 1fr;
    }

    /* Quiz ideas */
    #quiz-ideas .grid {
        grid-template-columns: 1fr;
    }

    /* Share modal */
    #shareModal > div {
        margin: 16px;
        max-height: 90vh;
        overflow-y: auto;
    }

    #shareModal .grid-cols-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    /* Smaller heading for mobile */
    #community h2 {
        font-size: 24px;
    }

    /* Stack email form elements */
    #leadMagnetForm button[type="submit"] {
        font-size: 16px;
        padding: 14px;
    }

    /* FAQ adjustments */
    #faq article {
        padding: 16px;
    }

    #faq h4 {
        font-size: 15px;
    }

    /* Template cards compact */
    #templates .bg-white.rounded-xl {
        padding: 16px;
    }
}

/* ===================================
   ACCESSIBILITY FOR NEW SECTIONS
   =================================== */

/* Focus states for new interactive elements */
.sample-template-btn:focus-visible,
#shareModal button:focus-visible,
#leadMagnetForm input:focus-visible,
#leadMagnetForm select:focus-visible,
#leadMagnetForm button:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

/* High contrast mode adjustments */
body.high-contrast #community {
    background: #1a1a2e !important;
}

body.high-contrast #shareModal > div {
    border: 3px solid #000;
}

body.high-contrast .sample-template-btn {
    text-decoration: underline;
}

/* Reduced motion for new animations */
@media (prefers-reduced-motion: reduce) {
    #shareModal > div,
    #leadMagnetForm .text-center,
    #community .animate-pulse,
    #templates > div > div.grid > div,
    #quiz-ideas article {
        animation: none !important;
        transition: none !important;
    }
}

/* ===================================
   SEO STRUCTURED DATA HINT STYLES
   =================================== */

/* These are visual hints for search engines */
[itemtype="https://schema.org/FAQPage"] article {
    border-left: 3px solid transparent;
}

[itemtype="https://schema.org/FAQPage"] article:hover {
    border-left-color: var(--primary);
}
