/* Reset và Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

/* Header Styles - Giống ai-chat */
.header {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    padding: 1rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.nav-menu {
    display: flex;
    gap: 1rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-link::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 ease;
}

.nav-link:hover::before {
    left: 100%;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 70%;
    height: 3px;
    background: #fbbf24;
    transform: translateX(-50%);
    border-radius: 2px;
}

.nav-auth-container {
    display: flex;
    align-items: center;
}

.nav-auth {
    display: flex;
    gap: 1rem;
}

.auth-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.auth-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.login-btn {
    background: #facc15;
    color: #b91c1c;
    font-weight: 600;
    border-color: #facc15;
}

.login-btn:hover {
    background: #f59e0b;
    border-color: #f59e0b;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.profile-menu {
    position: relative;
}

.profile-toggle {
    background: none;
    border: none;
    cursor: pointer;
}

.profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    object-fit: cover;
    display: block;
}

.profile-dropdown {
    position: absolute;
    top: 120%;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
    width: 200px;
    overflow: hidden;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    display: none;
}

.profile-dropdown.show {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #374151;
    text-decoration: none;
    font-size: 0.9rem;
}

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

.dropdown-item.active {
    background: #dc2626;
    color: white;
}

.dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 0.25rem 0;
}

.mobile-auth {
    display: none;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Main Content */
.main-content {
    padding: 40px 0;
    min-height: calc(100vh - 74px);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Page Header */
.page-header {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.3);
}

.header-text h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
}

.header-text p {
    color: #6b7280;
    font-size: 1.1rem;
}

/* Profile Layout */
.profile-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    align-items: start;
}

/* Sidebar */
.profile-sidebar {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: sticky;
    top: 100px;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: none;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 500;
    color: #6b7280;
    text-align: left;
    width: 100%;
}

.menu-item:hover {
    background: #f3f4f6;
    color: #374151;
    transform: translateX(4px);
}

.menu-item.active {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.3);
}

.menu-item.danger {
    color: #ef4444;
}

.menu-item.danger:hover {
    background: #fef2f2;
    color: #dc2626;
}

.menu-item i {
    font-size: 1.2rem;
    width: 20px;
}

/* Content Cards */
.profile-main {
    min-height: 600px;
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block;
}

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

.content-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.card-header {
    padding: 25px 30px;
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border-bottom: 1px solid #e5e7eb;
}

.card-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-header i {
    color: #dc2626;
}

.card-body {
    padding: 30px;
}

/* Profile Avatar Section */
.profile-avatar-section {
    text-align: center;
    margin-bottom: 30px;
}

.avatar-container {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
}

.user-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid #dc2626;
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.3);
}

.avatar-overlay {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 40px;
    height: 40px;
    background: #dc2626;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid white;
}

.avatar-overlay:hover {
    background: #b91c1c;
    transform: scale(1.1);
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.info-item {
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    border-left: 4px solid #dc2626;
}

.info-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.info-item label i {
    color: #dc2626;
    width: 16px;
}

.info-item span {
    font-size: 1.1rem;
    color: #1f2937;
    font-weight: 500;
}

/* Learning Stats */
.learning-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
    padding: 25px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.3);
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-info {
    flex: 1;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Learning Progress */
.learning-progress h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.progress-item {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid #dc2626;
    transition: all 0.3s ease;
}

.progress-item:hover {
    background: #f1f5f9;
    transform: translateX(4px);
}

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

.lesson-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 1.1rem;
}

.lesson-score {
    background: #dc2626;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.lesson-topic {
    color: #6b7280;
    font-size: 0.9rem;
}

.loading-placeholder {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

.loading-placeholder i {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #dc2626;
}

/* Form Styles */
.password-form {
    max-width: 500px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.form-group label i {
    color: #dc2626;
    width: 16px;
}

.input-container {
    position: relative;
}

.input-container input {
    width: 100%;
    padding: 16px;
    padding-right: 50px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.input-container input:focus {
    outline: none;
    border-color: #dc2626;
    background: white;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.toggle-password {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.toggle-password:hover {
    color: #dc2626;
}

/* Password Strength */
.password-strength {
    margin-top: 12px;
}

.strength-bar {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-text {
    font-size: 0.9rem;
    color: #6b7280;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    position: relative;
    overflow: hidden;
}

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

.btn-primary {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.4);
}

/* Danger Card */
.danger-card {
    border: 2px solid #fecaca;
}

.danger-card .card-header {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
}

.danger-card .card-header h2 {
    color: #dc2626;
}

.warning-message {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: #fef2f2;
    border-radius: 12px;
    border: 1px solid #fecaca;
    margin-bottom: 25px;
}

.warning-icon {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background: #ef4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.warning-content h3 {
    color: #dc2626;
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.warning-content p {
    color: #7f1d1d;
    margin-bottom: 10px;
}

.warning-content ul {
    color: #7f1d1d;
    margin-left: 20px;
    margin-bottom: 10px;
}

.warning-content li {
    margin-bottom: 4px;
}

/* Checkbox */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    cursor: pointer;
    font-weight: 500;
    color: #374151;
}

.checkbox-container input {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-container input:checked + .checkmark {
    background: #dc2626;
    border-color: #dc2626;
}

.checkbox-container input:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 12px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.show {
    display: flex;
}

.loading-spinner {
    background: white;
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.loading-spinner i {
    font-size: 2rem;
    color: #dc2626;
    margin-bottom: 15px;
}

.loading-spinner span {
    font-weight: 600;
    color: #374151;
}

/* Notification Styles - Giống ai-chat */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    min-width: 320px;
    max-width: 400px;
    z-index: 9999;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
}

.notification.notification-show {
    transform: translateX(0);
    opacity: 1;
}

.notification.notification-success {
    border-left: 4px solid #10b981;
}

.notification.notification-error {
    border-left: 4px solid #ef4444;
}

.notification-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 16px 20px;
}

.notification-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
}

.notification-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
    flex-shrink: 0;
    margin-top: 2px;
}

.notification-success .notification-icon {
    background: #10b981;
}

.notification-error .notification-icon {
    background: #ef4444;
}

.notification-message {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    line-height: 1.5;
    margin: 0;
}

.notification-close {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: 8px;
}

.notification-close:hover {
    color: #6b7280;
    background: #f3f4f6;
}

.notification-progress {
    height: 3px;
    background: #f3f4f6;
    position: relative;
    overflow: hidden;
}

.notification-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    width: 0%;
    animation: notification-progress 5s linear forwards;
}

.notification-error .notification-progress-bar {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

@keyframes notification-progress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* Responsive Design - Giống ai-chat */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
        z-index: 1001;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
        flex-direction: column;
        padding: 1rem 0;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }
    
    .nav-menu.mobile-open {
        display: flex;
    }
    
    .nav-link {
        padding: 1rem 1.5rem;
    }
    
    .desktop-auth {
        display: none !important;
    }
    
    .profile-menu {
        display: none !important;
    }
    
    .mobile-auth {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        margin-top: 1rem;
        padding: 1rem 1.5rem 0;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .profile-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .profile-sidebar {
        position: static;
    }
    
    .sidebar-menu {
        flex-direction: row;
        overflow-x: auto;
        gap: 12px;
        padding-bottom: 10px;
    }
    
    .menu-item {
        flex-shrink: 0;
        white-space: nowrap;
    }

    .container {
        padding: 0 15px;
    }
    
    .page-header {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .header-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .header-text h1 {
        font-size: 2rem;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .learning-stats {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .notification {
        top: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 20px 0;
    }
    
    .card-body {
        padding: 20px;
    }
    
    .user-avatar {
        width: 100px;
        height: 100px;
    }
    
    .avatar-overlay {
        width: 35px;
        height: 35px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
}

/* Ripple Effect */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: ripple-animation 0.6s linear;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.nav-link, .auth-link, .btn, .menu-item {
    position: relative;
    overflow: hidden;
}