* {
    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;
}

/* Notification System */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideInRight 0.3s ease-out;
}

.notification-content {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.notification-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.notification-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

.notification-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

.notification-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.notification-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

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

.container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    width: 90%;
    text-align: center;
    transition: all 0.3s ease;
}

.container:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

h1 {
    color: #4a5568;
    margin-bottom: 2rem;
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.screen {
    display: none;
    animation: fadeIn 0.5s ease-in;
}

.screen.active {
    display: block;
}

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

/* Authentication Form Styles */
.auth-form {
    max-width: 400px;
    margin: 0 auto;
    transition: all 0.3s ease;
}

.auth-form.shake {
    animation: shake 0.5s ease-in-out;
}

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

.benefits-box {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    border: 1px solid rgba(102, 126, 234, 0.2);
    animation: slideIn 0.6s ease-out;
}

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

.welcome-message {
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1rem;
    text-align: left;
}

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

.error-message {
    background: linear-gradient(135deg, #feb2b2, #fc8181);
    color: #742a2a;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    animation: errorSlide 0.3s ease-out;
    border: 1px solid #fc8181;
}

.field-error {
    color: #e53e3e;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    padding-left: 0.5rem;
    animation: errorSlide 0.3s ease-out;
}

.field-info {
    color: #667eea;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    padding-left: 0.5rem;
    animation: infoSlide 0.3s ease-out;
}

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

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

.success-message {
    background: linear-gradient(135deg, #9ae6b4, #68d391);
    color: #22543d;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    animation: successSlide 0.3s ease-out;
    border: 1px solid #68d391;
}

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

input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

input[type="text"].error,
input[type="email"].error,
input[type="password"].error {
    border-color: #e53e3e;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

input[type="text"].success,
input[type="email"].success,
input[type="password"].success {
    border-color: #38a169;
    box-shadow: 0 0 0 3px rgba(56, 161, 105, 0.1);
}

.btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

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

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

.btn-loader {
    display: inline-block;
}

.btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn.loading .btn-text {
    display: none;
}

.btn.loading .btn-loader {
    display: inline-block;
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* History Screen Styles */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #718096;
    font-size: 0.9rem;
    font-weight: 600;
}

.history-container {
    max-height: 400px;
    overflow-y: auto;
    background: white;
    border-radius: 15px;
    padding: 1rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    transition: background-color 0.3s ease;
}

.history-item:last-child {
    border-bottom: none;
}

.history-item:hover {
    background: #f7fafc;
}

.history-info {
    flex: 1;
}

.history-category {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.25rem;
}

.history-details {
    font-size: 0.85rem;
    color: #718096;
}

.history-score {
    text-align: right;
    margin-left: 1rem;
}

.score-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #667eea;
}

.score-percentage {
    font-size: 0.8rem;
    color: #718096;
}

.no-history {
    text-align: center;
    color: #718096;
    padding: 2rem;
    font-style: italic;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

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

select {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: white;
}

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

.btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0.5rem;
    min-width: 120px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

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

.btn.secondary {
    background: linear-gradient(135deg, #718096, #4a5568);
}

.question-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.question-text {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #2d3748;
}

.answer-option {
    display: block;
    width: 100%;
    padding: 1rem;
    margin-bottom: 0.8rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-size: 1rem;
}

.answer-option:hover {
    border-color: #667eea;
    background: #f7fafc;
    transform: translateX(5px);
}

.answer-option.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #e2e8f0;
    border-radius: 5px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    transition: width 0.3s ease;
    border-radius: 5px;
}

.score-display {
    font-size: 3rem;
    font-weight: 700;
    color: #667eea;
    margin: 1rem 0;
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2rem 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .history-item {
        flex-direction: column;
        text-align: center;
    }
    
    .history-score {
        margin-left: 0;
        margin-top: 0.5rem;
    }
}

.error-message {
    color: #e53e3e;
    background: #fed7d7;
    border: 1px solid #feb2b2;
    border-radius: 10px;
    padding: 1rem;
    margin: 1rem 0;
}

.timer-container {
    text-align: center;
    margin-bottom: 1.5rem;
}

.timer-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    position: relative;
    overflow: hidden;
}

.timer-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(231, 76, 60, 0.8);
    transform: rotate(-90deg);
    transform-origin: center;
    transition: transform 0.1s linear;
}

.timer-text {
    position: relative;
    z-index: 2;
}

.timer-label {
    color: #718096;
    font-size: 0.9rem;
}

.answer-option.correct {
    border-color: #38a169;
    background: linear-gradient(135deg, rgba(56, 161, 105, 0.1), rgba(72, 187, 120, 0.1));
    color: #38a169;
}

.answer-option.incorrect {
    border-color: #e53e3e;
    background: linear-gradient(135deg, rgba(229, 62, 62, 0.1), rgba(245, 101, 101, 0.1));
    color: #e53e3e;
}

.answer-option.disabled {
    pointer-events: none;
    opacity: 0.7;
}

.result-message {
    text-align: center;
    padding: 1rem;
    border-radius: 10px;
    margin: 1rem 0;
    font-weight: 600;
    font-size: 1.1rem;
}

.result-message.correct {
    background: #c6f6d5;
    color: #38a169;
    border: 2px solid #9ae6b4;
}

.result-message.incorrect {
    background: #fed7d7;
    color: #e53e3e;
    border: 2px solid #feb2b2;
}

.time-up-message {
    background: #fbb6ce;
    color: #d53f8c;
    border: 2px solid #f687b3;
}

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

    h1 {
        font-size: 2rem;
    }

    .question-text {
        font-size: 1.1rem;
    }

    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
}

/* Profile Page Styles */
.profile-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.profile-header {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
}

.back-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #5a67d8;
    transform: translateX(-2px);
}

.profile-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.avatar-section {
    flex-shrink: 0;
}

.profile-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #667eea;
}

.profile-avatar-large.default {
    background: #667eea;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: bold;
}

.user-details h2 {
    color: #4a5568;
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

.user-details .email {
    color: #718096;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.user-details .auth-method {
    color: #667eea;
    font-size: 0.9rem;
    font-weight: 600;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.stat-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #718096;
    font-size: 0.9rem;
    font-weight: 600;
}

.quiz-history-section {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.quiz-history-section h3 {
    color: #4a5568;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.quiz-history {
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.history-item:hover {
    background: #f7fafc;
    transform: translateX(5px);
}

.history-item:last-child {
    border-bottom: none;
}

.quiz-info h4 {
    color: #4a5568;
    margin-bottom: 0.25rem;
    font-size: 1.1rem;
}

.quiz-details {
    color: #718096;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.quiz-date {
    color: #a0aec0;
    font-size: 0.8rem;
}

.quiz-score {
    font-size: 1.5rem;
    font-weight: bold;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    color: white;
    min-width: 80px;
    text-align: center;
}

.quiz-score.excellent {
    background: #48bb78;
}

.quiz-score.good {
    background: #ed8936;
}

.quiz-score.needs-improvement {
    background: #f56565;
}

.no-history {
    text-align: center;
    color: #718096;
    font-style: italic;
    padding: 2rem;
}

.loading {
    text-align: center;
    color: #718096;
    padding: 2rem;
}

.profile-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn.secondary {
    background: #718096;
}

.btn.secondary:hover {
    background: #4a5568;
}

.btn.danger {
    background: #e53e3e;
}

.btn.danger:hover {
    background: #c53030;
}

/* Google OAuth Button Styles */
.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #3c4043;
    border: 1px solid #dadce0;
    border-radius: 4px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 1rem 0;
    text-decoration: none;
    width: 100%;
    box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.30), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
}

.google-btn:hover {
    background: #f8f9fa;
    border-color: #c1c7cd;
    box-shadow: 0 1px 3px 0 rgba(60, 64, 67, 0.30), 0 4px 8px 3px rgba(60, 64, 67, 0.15);
}

.google-btn:active {
    background: #f1f3f4;
    border-color: #c1c7cd;
    box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.30), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
}

.google-btn .google-icon {
    width: 18px;
    height: 18px;
    margin-right: 8px;
}

.google-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Profile Dropdown Styles */
.profile-dropdown {
    position: relative;
    display: inline-block;
}

.profile-button {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.profile-button:hover {
    background: #5a67d8;
}

.profile-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background: white;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    border-radius: 8px;
    z-index: 1000;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.dropdown-content.show {
    display: block;
    animation: dropdownShow 0.2s ease-out;
}

.dropdown-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f1f3f4;
    color: #4a5568;
    font-size: 0.9rem;
    transition: background 0.2s ease;
}

.dropdown-item:hover {
    background: #f8f9fa;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 4px 0;
}

.login-prompt-btn {
    background: #48bb78;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.login-prompt-btn:hover {
    background: #38a169;
}

/* Responsive design for profile page */
@media (max-width: 768px) {
    .profile-page {
        padding: 1rem;
    }
    
    .profile-info {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .quiz-score {
        align-self: flex-end;
    }
}

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