/* Global Styles */
:root {
    --primary-color: #4a6fa5;
    --secondary-color: #166088;
    --accent-color: #4fc3f7;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --danger-color: #f44336;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --text-color: #333;
    --text-light: #6c757d;
    --border-color: #dee2e6;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    background-color: #f5f7fa;
    line-height: 1.6;
}

.container {
    max-width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #fff;
}

/* Header Styles */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
}

.profile-section {
    display: flex;
    align-items: center;
}

.login-btn {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.login-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.profile-name {
    margin-right: 1rem;
    font-weight: 500;
}

/* Main Content Styles */
.main-content {
    flex: 1;
    padding: 1.5rem;
    padding-bottom: 80px; /* Space for bottom nav */
}

.page-title {
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
    font-size: 1.8rem;
}

/* Stats Section */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

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

.stat-card h3 {
    color: var(--text-light);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-list {
    max-height: 150px;
    overflow-y: auto;
}

.stat-list-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
}

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

/* Quick Links */
.quick-links {
    margin-bottom: 2rem;
}

.quick-links h2 {
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.link-card {
    background-color: white;
    border-radius: 8px;
    padding: 1.5rem 1rem;
    text-align: center;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s;
}

.link-card:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

.link-card i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--secondary-color);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.checklist {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.5rem;
}

.checklist-item {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

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

.checklist-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checklist-item input {
    margin-right: 0.5rem;
}

/* Button Styles */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
}

.btn-secondary {
    background-color: var(--light-color);
    color: var(--text-color);
}

.btn-secondary:hover {
    background-color: #e2e6ea;
}

.btn-warning {
    background-color: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background-color: #e68a00;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    text-decoration: underline;
    padding: 0;
    font-size: inherit;
}

/* History List */
.history-list {
    background-color: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.history-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.3s;
}

.history-item:hover {
    background-color: #f8f9fa;
}

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

.history-item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.history-item-title {
    font-weight: 500;
    color: var(--primary-color);
}

.history-item-date {
    color: var(--text-light);
    font-size: 0.9rem;
}

.history-item-details {
    display: none;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--border-color);
    margin-top: 0.5rem;
}

.history-item.active .history-item-details {
    display: block;
}

/* Progress Bar */
.progress-bar {
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.progress-fill {
    height: 100%;
    background-color: var(--success-color);
    width: 0%;
    transition: width 0.5s ease;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.tab-btn {
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-light);
    transition: all 0.3s;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Progress Container */
.progress-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.progress-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    padding: 1rem;
    background-color: #f8f9fa;
    font-weight: 500;
    border-bottom: 1px solid var(--border-color);
}

.chapter-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
}

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

.chapter-name {
    font-weight: 500;
}

.checkbox-container {
    display: flex;
    justify-content: center;
}

.checkbox-container input {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Auth Form */
.auth-form {
    max-width: 500px;
    margin: 0 auto;
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.auth-buttons {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
}

.auth-toggle {
    text-align: center;
    margin-top: 1rem;
    color: var(--text-light);
}

.error-message {
    color: var(--danger-color);
    margin-top: 1rem;
    text-align: center;
}

/* Profile View */
.profile-view {
    max-width: 1000px;
    margin: 0 auto;
}

.profile-header {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.profile-avatar {
    font-size: 3rem;
    color: var(--primary-color);
    margin-right: 1.5rem;
}

.profile-info h2 {
    margin-bottom: 0.5rem;
}

.profile-info p {
    color: var(--text-light);
}

/* Graph Container */
.graph-container {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

/* Subject Grid */
.subject-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.subject-card {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.subject-card h3 {
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.subject-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.subject-progress .progress-bar {
    flex: 1;
}

/* Bottom Navigation */
.bottom-nav {
    display: flex;
    justify-content: space-around;
    background-color: white;
    padding: 0.75rem 0;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-light);
    font-size: 0.8rem;
    transition: color 0.3s;
}

.nav-item i {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-item:hover {
    color: var(--primary-color);
}

/* Responsive Styles */
@media (max-width: 768px) {
    .header {
        padding: 0.75rem 1rem;
    }
    
    .main-content {
        padding: 1rem;
        padding-bottom: 70px;
    }
    
    .stats-section {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-avatar {
        margin-right: 0;
        margin-bottom: 1rem;
    }
    
    .auth-form {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.2rem;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .links-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .auth-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}
