@font-face {
    font-family: 'Amazon Ember';
    src: url('../font/AmazonEmber_Lt.woff') format('woff');
    font-weight: 300;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Amazon Ember', 'Comic Sans MS', 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 800px;
    width: 100%;
    padding: 40px;
    min-height: 600px;
}

.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.5s ease-in;
}

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

h1 {
    color: #667eea;
    text-align: center;
    margin-bottom: 30px;
    font-size: 2.5em;
}

h2 {
    color: #764ba2;
    text-align: center;
    margin-bottom: 20px;
    font-size: 2em;
}

.intro-text {
    font-size: 1.3em;
    line-height: 1.8;
    color: #333;
    margin-bottom: 30px;
    text-align: center;
}

.picture-container {
    text-align: center;
    margin-bottom: 30px;
}

.picture-container img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.question-text {
    font-size: 1.5em;
    color: #333;
    text-align: center;
    margin-bottom: 30px;
    font-weight: bold;
}

.answers-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

.answer-button {
    background: #f0f0f0;
    border: 3px solid #ddd;
    border-radius: 15px;
    padding: 20px;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Amazon Ember', 'Comic Sans MS', 'Arial', sans-serif;
}

.answer-button:hover {
    background: #e0e0e0;
    transform: scale(1.05);
}

.answer-button.selected {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.answer-button.correct {
    background: #4caf50;
    color: white;
    border-color: #4caf50;
}

.answer-button.incorrect {
    background: #f44336;
    color: white;
    border-color: #f44336;
}

.button {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 20px 50px;
    font-size: 1.5em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    margin: 20px auto;
    font-family: 'Amazon Ember', 'Comic Sans MS', 'Arial', sans-serif;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.button:hover {
    background: #764ba2;
    transform: scale(1.05);
}

.button:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

.feedback-message {
    text-align: center;
    font-size: 1.3em;
    margin: 20px 0;
    padding: 15px;
    border-radius: 10px;
    font-weight: bold;
}

.feedback-message.success {
    background: #c8e6c9;
    color: #2e7d32;
}

.feedback-message.error {
    background: #ffcdd2;
    color: #c62828;
}

.feedback-message.hidden {
    display: none !important;
}

.progress {
    text-align: center;
    color: #666;
    font-size: 1.2em;
    margin-bottom: 20px;
}

.summary-stats {
    background: #f5f5f5;
    border-radius: 15px;
    padding: 30px;
    margin: 30px 0;
}

.summary-stats h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.summary-stats p {
    font-size: 1.3em;
    color: #333;
    margin: 10px 0;
}

.celebration {
    text-align: center;
    font-size: 3em;
    margin: 20px 0;
}

.listening-indicator {
    text-align: center;
    padding: 15px;
    margin: 20px 0;
    border-radius: 10px;
    background: #e3f2fd;
    color: #1976d2;
    font-size: 1.2em;
    font-weight: bold;
    display: none;
    animation: pulse 1.5s ease-in-out infinite;
}

.listening-indicator.active {
    display: block;
}

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

.hidden {
    display: none !important;
}

/* Start Page Styles */
#start-page.active {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 600px;
}

.start-page-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.button.small {
    padding: 10px 25px;
    font-size: 1em;
}

.button.bottom-button {
    margin-top: auto;
    align-self: center;
}

/* Edit Questions Page Styles */
#edit-page.active {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#edit-page h1 {
    margin-bottom: 15px;
    font-size: 2em;
}

#edit-page .intro-text {
    font-size: 1em;
    margin-bottom: 20px;
}

.questions-editor {
    width: calc(100% - 20px);
    height: 400px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    margin: 0 auto 20px auto;
    resize: vertical;
    background: #f8f8f8;
    overflow-y: auto;
}

.questions-editor:focus {
    outline: none;
    border-color: #667eea;
    background: white;
}

.edit-buttons {
    display: flex;
    flex-direction: row;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.edit-buttons .button {
    padding: 12px 30px;
    font-size: 1.1em;
    margin: 0;
}

@media (max-width: 767px) {
    .edit-buttons {
        justify-content: center;
    }
}

.button.secondary {
    background: #6c757d;
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.4);
}

.button.secondary:hover {
    background: #5a6268;
}

.button.danger {
    background: #dc3545;
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.4);
}

.button.danger:hover {
    background: #c82333;
}

/* Scenarios Section Styles */
.scenarios-section {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    text-align: center;
}

.scenarios-title {
    color: #667eea;
    font-size: 1.5em;
    margin-bottom: 15px;
    font-weight: bold;
}

.scenarios-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.scenario-button {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 30px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Amazon Ember', 'Comic Sans MS', 'Arial', sans-serif;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
    min-width: 120px;
}

.scenario-button:hover {
    background: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(118, 75, 162, 0.4);
}

.scenario-button:active {
    transform: translateY(0);
}

@media (max-width: 767px) {
    .scenarios-buttons {
        flex-direction: column;
        width: 100%;
    }

    .scenario-button {
        width: 100%;
        max-width: 300px;
    }
}

/* Cards Page Styles - Combined from cards.css */
/* Remove container white background and styling for cards page */
body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    overflow: hidden;
    padding: 0;
}

.container {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    max-width: none;
    width: 100%;
    padding: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Override body styles for the slider page only */
#slider-page {
    background: transparent;
    overflow: hidden;
    width: 100%;
}

/* Add white background container for quiz pages */
#question-page,
#summary-page {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 800px;
    width: 100%;
    padding: 40px;
    min-height: 600px;
    position: relative;
}

.back-button {
    position: absolute;
    top: 14px;
    left: 14px;
    background: transparent;
    border: 1.5px solid #bbb;
    color: #888;
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 0.85em;
    cursor: pointer;
    line-height: 1.4;
}

.back-button:hover {
    border-color: #667eea;
    color: #667eea;
}

.slider-container {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.card-slider {
    display: flex;
    flex-direction: column;
    /* Vertical by default */
    gap: 40px;
    /* Increased gap for vertical flow */
    padding: 50px 0;

    /* Scroll Snap Magic */
    overflow-x: hidden;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;

    /* Center the active item */
    width: 100%;
    height: 100vh;
    align-items: center;

    /* Hide scrollbar */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
}

.card-slider::-webkit-scrollbar {
    display: none;
}

.card {
    flex: 0 0 auto;
    /* Allow height to be determined by CSS height property */
    width: 500px;
    /* Increased width for desktop */
    height: 700px;
    /* Increased height for desktop */
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    scroll-snap-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 30px;
    /* Increased padding */

    /* Transition attributes */
    opacity: 0.5;
    transform: scale(0.9);
    filter: grayscale(0.8);
    transition: all 0.4s ease-out;
    position: relative;
    overflow: hidden;
}

/* Active State */
.card.active {
    opacity: 1;
    transform: scale(1);
    filter: grayscale(0);
    box-shadow: 0 20px 50px rgba(102, 126, 234, 0.4);
    z-index: 10;
}

/* Card Content */
.card-image {
    width: 100%;
    height: 350px;
    /* Larger image area */
    object-fit: cover;
    border-radius: 15px;
    margin-bottom: 25px;
}

.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.card-title {
    font-size: 2em;
    /* Larger Title */
    color: #333;
    margin-bottom: 15px;
}

.card p {
    font-size: 1.2em;
    /* Larger text */
}

.card-actions {
    opacity: 0;
    pointer-events: none;
    /* Disable interaction when not active */
    transition: opacity 0.3s ease;
    transform: translateY(20px);
    margin-top: 20px;
    text-align: center;
}

.card.active .card-actions {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.btn {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 15px 30px;
    /* Larger button */
    font-size: 1.1em;
    border-radius: 30px;
    text-decoration: none;
    cursor: pointer;
    margin-top: 10px;
    border: none;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
    transition: transform 0.2s;
}

.btn:hover {
    transform: scale(1.05);
    background: #764ba2;
}

/* Vertical Spacers for Centering */
.card-slider::before,
.card-slider::after {
    content: '';
    flex: 0 0 20vh;
    /* Spacer to push first/last items to center */
    width: 100%;
    display: block;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .card-slider {
        padding: 100px 0;
        gap: 40px;
    }

    .card {
        width: 85%;
        /* Responsive width */
        height: 450px;
        /* Smaller height for mobile */
        padding: 20px;
    }

    .card-title {
        font-size: 1.5em;
    }

    .card-image {
        height: 200px;
    }

    .card p {
        font-size: 1em;
    }

    .btn {
        padding: 10px 20px;
        font-size: 1em;
    }

    /* Allow question/summary pages to scroll on mobile */
    body:has(#question-page.active),
    body:has(#summary-page.active) {
        overflow-y: auto;
    }

    .container:has(#question-page.active),
    .container:has(#summary-page.active) {
        align-items: flex-start;
        padding: 16px;
    }

    #question-page,
    #summary-page {
        min-height: unset;
        padding: 20px;
        margin: 0 auto;
    }

    .picture-container img {
        max-height: 200px;
    }

    .answer-button {
        padding: 14px 10px;
        font-size: 1em;
    }
}

/* Hint text */
.hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #666;
    font-size: 0.9em;
    pointer-events: none;
    z-index: 100;
    background: rgba(255, 255, 255, 0.7);
    padding: 5px 15px;
    border-radius: 20px;
}

/* Advertisement Card Styles */
.adv-card {
    background: linear-gradient(145deg, #fff9e6 0%, #fff3cc 100%);
}

.adv-card .card-image {
    object-fit: contain;
    background: #fffdf5;
}

.adv-card .card-title {
    color: #b38600;
}

.adv-card .btn {
    background: linear-gradient(135deg, #f5af19 0%, #f12711 100%);
}

.adv-card .btn:hover {
    background: linear-gradient(135deg, #f12711 0%, #f5af19 100%);
}

@media (max-width: 768px) {
    .adv-card .card-image {
        height: 200px;
    }
}

/* Front Page Styles */
#front-page {
    width: 100%;
    height: 100vh;
    justify-content: center;
    align-items: center;
}

#front-page.active {
    display: flex;
}

.front-page-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 800px;
    width: 90%;
    padding: 40px;
    text-align: center;
}

.front-page-title {
    color: #667eea;
    font-size: 2em;
    margin-bottom: 40px;
    line-height: 1.4;
}

.number-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    padding: 20px;
}

.number-button {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 2.5em;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    font-family: 'Amazon Ember', 'Comic Sans MS', 'Arial', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
}

.number-button:hover {
    transform: scale(1.15);
    box-shadow: 0 10px 30px rgba(118, 75, 162, 0.5);
}

.number-button:active {
    transform: scale(1.05);
}

.front-page-container p {
    font-size: 1.3em;
    color: #444;
    line-height: 1.8;
    margin: 10px 0;
    font-weight: 300;
}

.front-page-container > p:nth-of-type(1) {
    font-size: 1.2em;
    color: #667eea;
    font-weight: bold;
}

.front-page-container > p:nth-of-type(2) {
    font-size: 1.1em;
    color: #764ba2;
    font-style: italic;
}

.front-page-container hr {
    border: none;
    height: 1px;
    background: linear-gradient(to right, transparent, #ccc, transparent);
    margin: 25px 0;
}

.front-page-container > button {
    background: linear-gradient(135deg, #f5af19 0%, #f12711 100%);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 14px 40px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Amazon Ember', 'Comic Sans MS', 'Arial', sans-serif;
    box-shadow: 0 5px 15px rgba(245, 175, 25, 0.4);
    display: inline-block;
}

.front-page-container > button:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(241, 39, 17, 0.4);
}

@media (max-width: 768px) {
    .front-page-container {
        padding: 30px 20px;
    }

    .front-page-title {
        font-size: 1.5em;
        margin-bottom: 30px;
    }

    .front-page-container p {
        font-size: 1.1em;
    }

    .front-page-container > p:nth-of-type(1),
    .front-page-container > p:nth-of-type(2) {
        font-size: 1em;
    }

    .number-grid {
        gap: 15px;
        padding: 10px;
    }

    .number-button {
        width: 80px;
        height: 80px;
        font-size: 2em;
    }
}
