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

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 60px);
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

header p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

.topic-selector {
    background-color: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

label {
    font-weight: 500;
    display: block;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    color: #333;
    background-color: #f9f9f9;
    cursor: pointer;
}

select:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
}

button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #2980b9;
}

button:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

.flashcard-container {
    text-align: center;
}

.flashcard {
    width: 100%;
    max-width: 600px;
    min-height: 250px;
    margin: 0 auto;
    perspective: 1000px;
    margin-bottom: 3rem;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    min-height: 250px;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.flashcard.flipped .flashcard-inner {
    transform: rotateY(180deg);
}

.flashcard-front, .flashcard-back {
    position: absolute;
    width: 100%;
    min-height: 250px;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background-color: white;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
    box-sizing: border-box;
}

.flashcard-front h2, .flashcard-back h2 {
    color: #3498db;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.flashcard-front p, .flashcard-back p {
    font-size: 1.2rem;
    line-height: 1.6;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
    text-align: center;
}

.flashcard-back {
    transform: rotateY(180deg);
    background-color: #f1f9ff;
}

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

#back-btn {
    background-color: #e74c3c;
}

#back-btn:hover {
    background-color: #c0392b;
}

.progress {
    font-size: 1.1rem;
    font-weight: 500;
    color: #7f8c8d;
}

.disclaimer {
    text-align: center;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
}

.disclaimer p {
    font-size: 0.8rem;
    color: #95a5a6;
    font-style: italic;
    line-height: 1.4;
}

/* Landing Page Styles */
.landing-header {
    text-align: center;
    margin-bottom: 60px;
}

.landing-header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 1.2rem;
    color: #6c757d;
    font-weight: 400;
}

.landing-main {
    max-width: 1200px;
    margin: 0 auto;
}

.hero-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    margin-bottom: 80px;
    padding: 40px 0;
}

.hero-content h2 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #2c3e50;
    line-height: 1.2;
}

.hero-description {
    font-size: 1.1rem;
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 30px;
}

.cta-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-large {
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    display: inline-block;
}

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

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

.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.2);
}

.btn-demo {
    background: linear-gradient(135deg, #ff6b6b, #ffa500);
    color: white;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-demo::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 0.5s;
}

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

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.sample-flashcard {
    perspective: 1000px;
}

.flashcard-demo {
    width: 300px;
    height: 200px;
    perspective: 1000px;
    cursor: pointer;
    animation: float 3s ease-in-out infinite;
}

.flashcard-demo-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.flashcard-demo.flipped .flashcard-demo-inner {
    transform: rotateY(180deg);
}

.flashcard-demo-front, .flashcard-demo-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.3);
    padding: 30px;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
}

.flashcard-demo-front {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.flashcard-demo-back {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    transform: rotateY(180deg);
}

.flashcard-demo-front h3, .flashcard-demo-back h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.flashcard-demo-front p, .flashcard-demo-back p {
    font-size: 1rem;
    line-height: 1.4;
    margin-bottom: 10px;
}

.flip-hint {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-top: 10px;
    font-style: italic;
}

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

.innovation-highlight {
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
}

.innovation-content h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.innovation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.innovation-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.innovation-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.innovation-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.innovation-item h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #fff;
}

.innovation-item p {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

.features-section {
    margin-bottom: 80px;
    text-align: center;
}

/* Chat Showcase Section */
.chat-showcase-section {
    margin-bottom: 80px;
    text-align: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 60px 40px;
    border-radius: 20px;
}

.chat-showcase-section h2 {
    font-size: 2.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #2c3e50;
}

.section-description {
    font-size: 1.1rem;
    color: #6c757d;
    margin-bottom: 50px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.chat-screenshots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    margin-top: 40px;
    justify-items: center;
}

.screenshot-container {
    text-align: center;
}

.phone-mockup {
    width: 280px;
    height: 500px;
    background: #1a1a1a;
    border-radius: 25px;
    padding: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    position: relative;
}

.phone-mockup::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: #333;
    border-radius: 2px;
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: #f8f9fa;
    border-radius: 15px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.chat-header {
    background: #52a9de;
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.chat-title {
    font-size: 0.9rem;
}

.close-btn {
    font-size: 1.2rem;
    cursor: pointer;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    background: #f8f9fa;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-message {
    background: #e9ecef;
    padding: 12px;
    border-radius: 15px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    line-height: 1.4;
    text-align: left;
}

.ai-message p {
    margin: 0;
    color: #333;
}

.suggestion-btn {
    background: #52a9de;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    align-self: center;
    margin: 5px 0;
    cursor: pointer;
}

.user-message {
    background: #dee2e6;
    padding: 8px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-style: italic;
    color: #6c757d;
    text-align: left;
    margin-top: 5px;
}

.chat-input {
    padding: 10px;
    background: white;
    border-top: 1px solid #dee2e6;
    display: flex;
    gap: 8px;
    align-items: center;
}

.chat-input input {
    flex: 1;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    padding: 8px 12px;
    font-size: 0.8rem;
    outline: none;
}

.chat-input button {
    background: #52a9de;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
}

.screenshot-caption {
    margin-top: 20px;
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
}

.features-section h2 {
    font-size: 2.2rem;
    font-weight: 600;
    margin-bottom: 50px;
    color: #2c3e50;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

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

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #2c3e50;
}

.feature-card p {
    color: #6c757d;
    line-height: 1.6;
}

.subjects-section {
    margin-bottom: 80px;
    text-align: center;
}

.subjects-section h2 {
    font-size: 2.2rem;
    font-weight: 600;
    margin-bottom: 40px;
    color: #2c3e50;
}

.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.subject-item {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.subject-item:hover {
    transform: scale(1.05);
}

.cta-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 40px;
    border-radius: 20px;
    text-align: center;
    margin-bottom: 60px;
}

.cta-content h2 {
    font-size: 2.2rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.cta-content p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.cta-note {
    margin-top: 20px;
    font-size: 1rem;
    opacity: 0.8;
}

.link-primary {
    color: #ffd700;
    text-decoration: none;
    font-weight: 600;
}

.link-primary:hover {
    text-decoration: underline;
}

/* Responsive Design for Landing Page */
@media (max-width: 768px) {
    .landing-header h1 {
        font-size: 2.2rem;
    }
    
    .hero-section {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    
    .hero-content h2 {
        font-size: 2rem;
    }
    
    .cta-buttons {
        justify-content: center;
    }
    
    .btn-large {
        padding: 12px 24px;
        font-size: 1rem;
    }
    
    .flashcard-demo {
        width: 250px;
        height: 160px;
    }
    
    .flashcard-demo-front, .flashcard-demo-back {
        padding: 20px;
    }
    
    .flashcard-demo-front h3, .flashcard-demo-back h3 {
        font-size: 1rem;
        margin-bottom: 10px;
    }
    
    .flashcard-demo-front p, .flashcard-demo-back p {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }
    
    .flip-hint {
        font-size: 0.7rem;
        margin-top: 8px;
    }
    
    /* Chat Showcase Responsive */
    .chat-showcase-section {
        padding: 40px 20px;
        margin-bottom: 60px;
    }

    .chat-showcase-section h2 {
        font-size: 1.8rem;
    }

    .section-description {
        font-size: 1rem;
        margin-bottom: 30px;
    }

    .chat-screenshots {
        grid-template-columns: 1fr;
        gap: 30px;
        margin-top: 30px;
    }

    .phone-mockup {
        width: 250px;
        height: 450px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .subjects-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .cta-section {
        padding: 40px 20px;
    }
}

footer {
    text-align: center;
    padding: 1rem;
    background-color: #2c3e50;
    color: white;
    font-size: 0.9rem;
}

.easter-egg {
    color: #5a6c7d;
    font-size: 0.75rem;
    margin-top: 0.3rem;
}

/* Registration styles */
.registration-container {
    max-width: 500px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.registration-form {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

.registration-form h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
}

.register-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.register-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
    transform: translateY(-2px);
}

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

.message {
    padding: 12px;
    border-radius: 8px;
    margin-top: 1rem;
    text-align: center;
    font-weight: 500;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.info {
    background-color: #e7f3ff;
    color: #0066cc;
    border-left: 4px solid #0066cc;
}

/* Invite Status Styles */
.invite-status {
    margin-top: 0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.invite-status.checking {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.invite-status.valid {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.invite-status.invalid {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.login-link {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

.login-link a {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}

.login-link a:hover {
    text-decoration: underline;
}

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

/* Login page styles */
.login-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 30px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.login-container h1 {
    text-align: center;
    color: #333;
    margin-bottom: 10px;
}

.login-description {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
    line-height: 1.5;
}

.login-form {
    display: flex;
    flex-direction: column;
}

.loading-spinner {
    color: #666;
}

/* Register link */
.register-link {
    text-align: center;
    margin-top: 20px;
}

.register-link a {
    color: #007bff;
    text-decoration: none;
}

.register-link a:hover {
    text-decoration: underline;
}

/* Responsive design for login */
@media (max-width: 480px) {
    .login-container {
        margin: 20px;
        padding: 20px;
    }
    
    .login-description {
        font-size: 13px;
    }
}

/* Verification page styles */
.verify-container {
    max-width: 500px;
    margin: 50px auto;
    padding: 40px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.verify-loading h1,
.verify-success h1,
.verify-error h1 {
    margin-bottom: 20px;
    color: #333;
}

.verify-loading p,
.verify-success p,
.verify-error p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

.loading-spinner-large {
    font-size: 48px;
    margin: 20px 0;
    animation: spin 2s linear infinite;
}

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

.verify-success {
    color: #28a745;
}

.verify-success h1 {
    color: #28a745;
}

.verify-error {
    color: #dc3545;
}

.verify-error h1 {
    color: #dc3545;
}

.redirect-info {
    margin-top: 30px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
    font-size: 14px;
}

.redirect-info a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.redirect-info a:hover {
    text-decoration: underline;
}

.error-actions {
    margin-top: 30px;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
    display: inline-block;
}

.btn-secondary:hover {
    background: #5a6268;
    color: white;
    text-decoration: none;
}

/* Responsive design for verification */
@media (max-width: 480px) {
    .verify-container {
        margin: 20px;
        padding: 30px 20px;
    }
    
    .error-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        max-width: 250px;
    }
}

/* Chat Widget Styles */
.chat-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: auto;
    min-width: 280px;
    height: 60px;
    border-radius: 30px;
    background-color: #3498db;
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 20px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
}

.chat-toggle:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.chat-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.chat-text {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-widget {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    height: 500px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    background-color: #3498db;
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

.chat-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #f8f9fa;
    max-height: 350px;
    min-height: 200px;
}

.chat-message {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    max-width: 80%;
    word-wrap: break-word;
}

.chat-message.user {
    background-color: #3498db;
    color: white;
    margin-left: auto;
    text-align: right;
}

.chat-message.bot {
    background-color: #e9ecef;
    color: #333;
}

.chat-input-container {
    padding: 15px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
}

#chat-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: 'Poppins', sans-serif;
}

#chat-send {
    padding: 8px 12px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    height: 36px;
    width: 36px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#chat-send:hover {
    background-color: #2980b9;
}

.chat-loading {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #7f8c8d;
    font-style: italic;
}

.chat-loading::after {
    content: '...';
    animation: dots 1.5s infinite;
}

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

/* User Info Widget Styles */
.user-info-widget {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
}

.user-info-widget button {
    transition: all 0.2s ease;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
}

.user-info-widget button:hover {
    background: #c82333 !important;
    transform: scale(1.05);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .chat-widget {
        width: calc(100vw - 20px);
        height: calc(100vh - 160px);
        max-height: 500px;
        bottom: 70px;
        right: 10px;
        left: 10px;
    }
    
    /* Add top spacing for header to prevent overlap with logout widget */
    header {
        margin-top: 80px;
        margin-bottom: 2rem;
    }
    
    .container {
        padding-top: 1rem;
        padding-bottom: 100px;
    }
    
    footer {
        margin-bottom: 20px;
    }
    
    .chat-body {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }
    
    .chat-messages {
        flex: 1;
        padding: 10px;
        overflow-y: auto;
        background-color: #f8f9fa;
        min-height: 0;
    }
    
    .chat-input-container {
        padding: 10px;
        border-top: 1px solid #e9ecef;
        display: flex !important;
        gap: 8px;
        background-color: white;
        flex-shrink: 0;
        min-height: 68px;
        box-sizing: border-box;
    }
    
    #chat-input {
        flex: 1;
        padding: 12px;
        border: 1px solid #ddd;
        border-radius: 5px;
        font-family: 'Poppins', sans-serif;
        font-size: 16px;
        height: 44px;
        box-sizing: border-box;
        -webkit-appearance: none;
        appearance: none;
    }
    
    #chat-send {
        padding: 0 12px;
        background-color: #3498db;
        color: white;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        font-family: 'Poppins', sans-serif;
        height: 36px;
        width: 36px;
        white-space: nowrap;
        flex-shrink: 0;
        box-sizing: border-box;
        font-size: 14px;
    }
    
    .chat-toggle {
        min-width: 200px;
        height: 50px;
        bottom: 15px;
        right: 15px;
    }
    
    .chat-icon {
        font-size: 20px;
    }
    
    .chat-text {
        font-size: 12px;
    }
    
    .container {
        padding: 1rem;
    }
    
    .flashcard {
        min-height: 200px;
    }
    
    .flashcard-inner {
        min-height: 200px;
    }
    
    .flashcard-front, .flashcard-back {
        min-height: 200px;
        padding: 1.5rem;
    }
    
    .flashcard-front p, .flashcard-back p {
        font-size: 1rem;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    button {
        width: 100%;
        max-width: 300px;
    }
}