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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    line-height: 1.6;
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    text-align: center;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.title-section h1 {
    font-size: 2.5rem;
    color: #4a5568;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.welcome-text {
    color: #4a5568;
    font-weight: 500;
    font-size: 0.9rem;
}

.auth-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.auth-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auth-btn.signin {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.auth-btn.signup {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
    color: white;
}

.auth-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.logout-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logout-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(229, 62, 62, 0.3);
}

.hidden {
    display: none !important;
}

.subtitle {
    color: #718096;
    font-size: 1.1rem;
    margin-bottom: 2rem;
    font-weight: 400;
}

.topic-selection {
    margin-bottom: 2rem;
}

.progress-section {
    margin-bottom: 2rem;
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.progress-label {
    font-weight: 600;
    color: #4a5568;
    font-size: 1rem;
}

.progress-info {
    font-weight: 500;
    color: #718096;
    font-size: 0.9rem;
}

.progress-container {
    position: relative;
}

.progress-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #e2e8f0;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.progress-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.progress-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.progress-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.progress-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.progress-slider:focus {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.topic-selection label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #4a5568;
}

#topic-select {
    width: 100%;
    max-width: 300px;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    background: white;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.3s ease;
}

#topic-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.control-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 120px;
    justify-content: center;
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.control-btn:active {
    transform: translateY(0);
}

.control-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.control-btn.secondary {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    color: #8b4513;
}

.control-btn:not(.primary):not(.secondary) {
    background: #f7fafc;
    color: #4a5568;
    border: 2px solid #e2e8f0;
}

.control-btn:not(.primary):not(.secondary):hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.control-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

.phrase-display {
    background: #f7fafc;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1rem;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.phrase-counter {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 1rem;
    font-weight: 500;
}

.phrase-content {
    font-size: 1.1rem;
}

.french-text {
    font-size: 1.4rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1rem;
    font-style: italic;
}

.english-text {
    font-size: 1.1rem;
    color: #4a5568;
    font-weight: 500;
}

.audio-status {
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: #718096;
}

.audio-status.playing {
    color: #38a169;
    font-weight: 500;
}

.audio-status.error {
    color: #e53e3e;
    font-weight: 500;
}

footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
    color: #718096;
    font-size: 0.9rem;
}

.copyright {
    font-size: 0.8rem;
    color: #a0aec0;
    margin-top: 0.5rem;
    font-weight: 400;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem;
        margin: 1rem;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .title-section h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .user-section {
        justify-content: center;
        flex-direction: column;
        gap: 0.5rem;
    }

    .auth-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }

    .auth-btn {
        width: 100%;
        justify-content: center;
    }
    
    .header-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .premium-btn {
        width: 100%;
        justify-content: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-header, .modal-body {
        padding: 1.5rem;
    }

    .controls {
        gap: 0.8rem;
    }

    .control-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
        min-width: 100px;
    }

    .phrase-display {
        padding: 1.5rem;
    }

    .french-text {
        font-size: 1.2rem;
    }

    .english-text {
        font-size: 1rem;
    }

    .progress-section {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .controls {
        flex-direction: column;
        align-items: center;
    }

    .control-btn {
        width: 100%;
        max-width: 200px;
    }
}

/* Premium Button */
.premium-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.4);
}

.premium-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(240, 147, 251, 0.6);
}

.premium-btn:active {
    transform: translateY(0);
}

/* Payment Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    color: #4a5568;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.close-modal {
    background: none;
    border: none;
    color: #718096;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-modal:hover {
    background: #f7fafc;
    color: #4a5568;
}

.modal-body {
    padding: 2rem;
}

.premium-features {
    margin-bottom: 2rem;
}

.premium-features h4 {
    color: #4a5568;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.premium-features ul {
    list-style: none;
    space: 0.75rem;
}

.premium-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    color: #4a5568;
    font-weight: 500;
}

.premium-features li i {
    color: #48bb78;
    font-size: 1rem;
}

.payment-form {
    border-top: 1px solid #e2e8f0;
    padding-top: 2rem;
}

.card-element {
    background: #f7fafc;
    padding: 1rem;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    margin-bottom: 1rem;
    transition: border-color 0.3s ease;
}

.card-element:focus-within {
    border-color: #667eea;
}

.card-errors {
    color: #e53e3e;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    min-height: 1.5rem;
}

.pay-button {
    width: 100%;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.pay-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.4);
}

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

.payment-success {
    text-align: center;
    padding: 2rem 0;
}

.success-message i {
    color: #48bb78;
    font-size: 3rem;
    margin-bottom: 1rem;
}

.success-message h4 {
    color: #4a5568;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.success-message p {
    color: #718096;
}

/* Login Required Modal Styles */
.login-required-content {
    text-align: center;
    padding: 20px;
}

.login-required-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: white;
    margin: 0 auto 20px auto;
}

.login-required-content p {
    font-size: 16px;
    color: #4a5568;
    margin-bottom: 25px;
    line-height: 1.5;
}

.login-required-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.create-account-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.create-account-btn:hover {
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.sign-in-btn {
    background: #f7fafc;
    color: #4a5568;
    border: 2px solid #e2e8f0;
}

.sign-in-btn:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
    transform: translateY(-2px);
}

.login-note {
    color: #718096;
    font-size: 14px;
    font-style: italic;
}

/* Premium locked content styles */
.premium-locked {
    text-align: center;
    padding: 40px 20px;
    color: #718096;
    border: 2px dashed #e2e8f0;
    border-radius: 12px;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
}

.premium-locked i {
    font-size: 48px;
    color: #cbd5e0;
    margin-bottom: 15px;
}

.premium-locked strong {
    display: block;
    font-size: 18px;
    color: #4a5568;
    margin-bottom: 10px;
}

.premium-locked small {
    color: #a0aec0;
    font-size: 14px;
}

/* Animation for reveal */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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