:root {
    --bg-color: #0b0f19;
    --surface-color: rgba(255, 255, 255, 0.03);
    --surface-border: rgba(255, 255, 255, 0.08);
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #ec4899;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #10b981;
    --danger: #ef4444;
    --glass-blur: blur(12px);
    --font-family: 'Inter', sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background Orbs */
.bg-orbs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s infinite alternate ease-in-out;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -10%;
    left: -10%;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: var(--secondary);
    bottom: -10%;
    right: -5%;
    animation-delay: -5s;
}

.orb-3 {
    width: 250px;
    height: 250px;
    background: #8b5cf6;
    top: 40%;
    left: 40%;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    backdrop-filter: var(--glass-blur);
    background: rgba(11, 15, 25, 0.6);
}

.glass {
    background: var(--surface-color);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    backdrop-filter: var(--glass-blur);
}

/* Sidebar */
.sidebar {
    width: 260px;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--surface-border);
    background: rgba(0, 0, 0, 0.2);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: #fff;
}

.logo ion-icon {
    color: var(--primary);
    font-size: 2rem;
}

nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(5px);
}

.nav-item.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.15) 0%, transparent 100%);
    border-left: 3px solid var(--primary);
}

.nav-item ion-icon {
    font-size: 1.25rem;
}

.sidebar-footer {
    margin-top: auto;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--surface-border);
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface-color);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-info .name {
    font-weight: 600;
    font-size: 0.9rem;
}

.user-info .status {
    font-size: 0.75rem;
    color: var(--primary);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem 3rem;
    overflow-y: auto;
    height: 100vh;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.top-header h1 {
    font-size: 1.8rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

.icon-btn {
    background: var(--surface-color);
    border: 1px solid var(--surface-border);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.2rem;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.section {
    animation: fadeIn 0.4s ease forwards;
}

.section.hidden {
    display: none;
}

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

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

.card {
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px 0 rgba(0, 0, 0, 0.4);
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

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

.card .highlight {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.card .subtext {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin: 1rem 0 0.5rem;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 3px;
}

.ai-card {
    cursor: pointer;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(236, 72, 153, 0.05));
    border: 1px solid rgba(236, 72, 153, 0.2);
}

.ai-card .card-icon {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
}

.upcoming-exams {
    padding: 1.5rem;
}

.upcoming-exams h2 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.exam-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.exam-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    border-left: 4px solid var(--primary);
}

.exam-item.s2 {
    border-left-color: var(--secondary);
}

/* Timetable */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.25rem;
    border-radius: 8px;
    border: 1px solid var(--surface-border);
}

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

.tab-btn.active {
    background: var(--surface-color);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.table-container {
    padding: 1.5rem;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th, td {
    padding: 1rem;
    border-bottom: 1px solid var(--surface-border);
}

th {
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

td:first-child {
    font-weight: 600;
}

/* To-Do List */
.todo-container {
    padding: 2rem;
    max-width: 800px;
}

.todo-input-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.todo-input-group input {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--surface-border);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.todo-input-group input:focus {
    border-color: var(--primary);
}

.todo-input-group button {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    transition: background 0.3s;
}

.todo-input-group button:hover {
    background: var(--primary-hover);
}

.todo-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.todo-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    transition: transform 0.2s, background 0.2s;
}

.todo-item:hover {
    transform: translateX(5px);
    background: rgba(255, 255, 255, 0.04);
}

.checkbox-container {
    display: block;
    position: relative;
    padding-left: 35px;
    cursor: pointer;
    font-size: 22px;
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: -12px;
    left: 0;
    height: 24px;
    width: 24px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--surface-border);
    border-radius: 6px;
    transition: all 0.2s;
}

.checkbox-container:hover input ~ .checkmark {
    background-color: rgba(255, 255, 255, 0.2);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 8px;
    top: 4px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.task-text {
    flex: 1;
    font-size: 1.05rem;
    transition: color 0.3s;
}

.task-text.completed {
    text-decoration: line-through;
    color: var(--text-muted);
}

.delete-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    transition: color 0.2s;
}

.delete-btn:hover {
    color: var(--danger);
}

/* AI Buttons & Features */
.primary-btn {
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.ai-btn ion-icon {
    font-size: 1.2rem;
    animation: pulse 2s infinite;
}

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

/* Study Plan Generator */
.study-plan-generator {
    padding: 2rem;
    max-width: 800px;
}

.generator-controls {
    display: grid;
    gap: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.input-group select {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--surface-border);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    outline: none;
}

.input-group select option {
    background: var(--bg-color);
}

.w-full {
    width: 100%;
    justify-content: center;
}

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-2 { margin-bottom: 2rem; }

.ai-processing {
    text-align: center;
    padding: 3rem 0;
}

.scanner {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    position: relative;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.scanner::after {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    animation: scan 1.5s infinite;
}

@keyframes scan {
    0% { left: -50%; }
    100% { left: 100%; }
}

.generated-plan {
    margin-top: 2rem;
    border-top: 1px solid var(--surface-border);
    padding-top: 2rem;
}

.day-plan {
    background: rgba(255, 255, 255, 0.02);
    border-left: 3px solid var(--primary);
    padding: 1.5rem;
    border-radius: 0 12px 12px 0;
    margin-bottom: 1rem;
}

.day-plan h4 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.day-plan ul {
    list-style: none;
    margin-top: 0.5rem;
}

.day-plan li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    font-size: 0.95rem;
}

.day-plan li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        padding: 1rem;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        border-right: none;
        border-bottom: 1px solid var(--surface-border);
    }
    
    .logo {
        margin-bottom: 0;
    }
    
    nav {
        display: none;
    }
    
    .sidebar-footer {
        display: none;
    }
    
    .main-content {
        padding: 1rem;
    }
}
