/* css/style.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #0D47A1;
    --primary-dark: #0a3a82;
    --primary-light: #1565C0;
    --accent: #F59E08;
    --accent-dark: #E65100;
    --success: #10B981;
    --success-dark: #059669;
    --purple: #885CF6;
    --purple-dark: #7C3AED;
    --dark: #0B1020;
    --dark-light: #1F2937;
    --light: #F4F6F8;
    --light-gray: #E5E7EB;
    --text-dark: #111827;
    --text-gray: #6B7280;
    --text-light: #FFFFFF;
    --error: #EF4444;
    --warning: #F59E0B;
    --border-radius: 16px;
    --border-radius-sm: 12px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--light);
    color: var(--text-dark);
}

/* Auth Pages */
.auth-container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

.brand {
    text-align: center;
    margin-bottom: 2rem;
}

.logo {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.logo span:first-child {
    color: var(--primary);
}

.logo span:last-child {
    color: var(--accent);
}

.tagline {
    color: var(--text-gray);
    font-size: 0.95rem;
}

.auth-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--light);
}

.tab {
    flex: 1;
    text-align: center;
    padding: 0.75rem;
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-gray);
    transition: all 0.3s;
    position: relative;
    font-family: inherit;
}

.tab.active {
    color: var(--primary);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
}

.form {
    display: none;
}

.form.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
    font-size: 0.875rem;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-gray);
    font-size: 1rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 2px solid var(--light-gray);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 71, 161, 0.1);
}

.form-group input.error {
    border-color: var(--error);
}

.error-message {
    color: var(--error);
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: none;
}

.error-message.show {
    display: block;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-gray);
    font-size: 1rem;
}

.btn-submit {
    width: 100%;
    padding: 0.875rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 1rem;
    font-family: inherit;
}

.btn-submit:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: var(--light-gray);
}

.divider span {
    background: white;
    padding: 0 1rem;
    position: relative;
    color: var(--text-gray);
    font-size: 0.875rem;
}

.demo-notice {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #FEF3C7;
    border-radius: 12px;
    font-size: 0.875rem;
    color: #92400E;
}

.alert {
    padding: 0.875rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    display: none;
}

.alert.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

.alert-error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.alert-success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
    margin-right: 0.5rem;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Dashboard Layout */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--light-gray);
    text-align: center;
}

.user-info {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--light);
    border-radius: var(--border-radius-sm);
}

.user-avatar {
    width: 60px;
    height: 60px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    font-size: 1.5rem;
    color: white;
    font-weight: bold;
}

.user-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.user-email {
    font-size: 0.75rem;
    color: var(--text-gray);
}

.nav-menu {
    padding: 1rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--text-gray);
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
}

.nav-item i {
    width: 24px;
    font-size: 1.25rem;
}

.nav-item:hover {
    background: var(--light);
    color: var(--primary);
}

.nav-item.active {
    background: rgba(13, 71, 161, 0.1);
    color: var(--primary);
    border-right: 3px solid var(--primary);
}

.main-content {
    margin-left: 280px;
    padding: 1.5rem;
    min-height: 100vh;
}

@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
    }
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--primary);
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
}

.page-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--primary);
}

.logout-btn {
    background: var(--error);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logout-btn:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.stat-icon {
    font-size: 2rem;
    color: var(--primary);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.stat-label {
    color: var(--text-gray);
    font-size: 0.875rem;
}

/* Progress Section */
.progress-section {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.progress-title {
    font-weight: 600;
    font-size: 1.125rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.progress-percent {
    color: var(--primary);
    font-weight: 700;
}

.progress-bar-container {
    background: var(--light-gray);
    border-radius: 10px;
    height: 32px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    background: var(--primary);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    transition: width 0.5s ease;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.feature-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.feature-description {
    color: var(--text-gray);
    font-size: 0.875rem;
}

.challenge-card {
    border: 2px solid var(--accent);
}

.challenge-card .feature-title {
    color: var(--accent-dark);
}

/* Activity List */
.activity-list {
    background: white;
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: var(--shadow-md);
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--light-gray);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    background: var(--light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.25rem;
}

.activity-details {
    flex: 1;
}

.activity-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-gray);
}

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

@media (max-width: 640px) {
    .main-content {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
    }
}

/* Button Styles */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-accent {
    background: var(--accent);
    color: white;
}

.btn-accent:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: var(--success-dark);
    transform: translateY(-2px);
}

.btn-purple {
    background: var(--purple);
    color: white;
}

.btn-purple:hover {
    background: var(--purple-dark);
    transform: translateY(-2px);
}