:root {
    --bg-color: #0f172a;
    /* Dark sleek blue */
    --surface-color: rgba(30, 41, 59, 0.7);
    /* Glassmorphism surface */
    --surface-border: rgba(255, 255, 255, 0.1);
    --primary-color: #8b5cf6;
    /* Vibrant purple */
    --primary-hover: #7c3aed;
    --success-color: #10b981;
    --success-light: rgba(16, 185, 129, 0.2);
    --danger-color: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.2);
    --warning-color: #f59e0b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --font-family: 'Outfit', sans-serif;
    --border-radius-lg: 24px;
    --border-radius-md: 16px;
    --border-radius-sm: 8px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    background-image: radial-gradient(circle at 15% 50%, rgba(139, 92, 246, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.1), transparent 25%);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Base Utility Classes */
.mt-2 {
    margin-top: 0.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.mt-8 {
    margin-top: 2rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.text-center {
    text-align: center;
}

.text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}

.text-xl {
    font-size: 1.25rem;
}

.text-2xl {
    font-size: 1.5rem;
}

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

.font-mono {
    font-family: monospace;
}

.opacity-70 {
    opacity: 0.7;
}

.opacity-80 {
    opacity: 0.8;
}

.text-muted {
    color: var(--text-muted);
}

.text-primary {
    color: var(--primary-color);
}

.danger-text {
    color: var(--danger-color);
}

.w-full {
    width: 100%;
}

.d-flex {
    display: flex;
}

.flex-column {
    flex-direction: column;
}

.flex-row {
    flex-direction: row;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

/* App Layout */
#app {
    max-width: 480px;
    margin: 0 auto;
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    background: inherit;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

.view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    padding: 24px;
    overflow-y: auto;
    transition: transform var(--transition), opacity var(--transition);
    opacity: 0;
    pointer-events: none;
    transform: translateX(20px);
    display: flex;
    flex-direction: column;
}

.view.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

/* Headers */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, #cbd5e1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

header p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 4px;
}

.icon-btn {
    background: var(--surface-color);
    border: 1px solid var(--surface-border);
    color: var(--text-main);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: var(--transition);
}

.icon-btn:hover,
.icon-btn:active {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

/* Cards & Glassmorphism */
.glass-card,
.glass-form,
.subject-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.4));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius-md);
    padding: 20px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.card {
    display: flex;
    align-items: center;
    gap: 16px;
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.2);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.card-info .label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-info h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-top: 2px;
}

/* Sections */
.section-header {
    margin-top: 32px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* Buttons */
button {
    font-family: inherit;
    outline: none;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary,
.btn-secondary,
.btn-danger-outline {
    width: 100%;
    padding: 14px;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #5b21b6);
    color: #fff;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary:hover,
.btn-primary:active {
    background: linear-gradient(135deg, var(--primary-hover), #4c1d95);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all var(--transition);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-danger-outline {
    background: transparent;
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

.btn-danger-outline:hover {
    background: var(--danger-light);
}

.text-btn {
    background: transparent;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: var(--border-radius-sm);
}

.text-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Forms */
.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}

.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 14px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--surface-border);
    border-radius: var(--border-radius-sm);
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

/* FAB */
.fab {
    position: fixed;
    bottom: 24px;
    right: 50%;
    transform: translateX(calc(50% + 180px));
    /* Align with max-width */
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.5);
    z-index: 100;
    transition: var(--transition);
}

@media (max-width: 480px) {
    .fab {
        transform: translateX(0);
        right: 24px;
    }
}

.fab:hover,
.fab:active {
    transform: translateY(-4px);
    /* Hover state needs media query adjust if complex */
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.6);
}

@media (max-width: 480px) {

    .fab:hover,
    .fab:active {
        transform: translateY(-4px);
    }
}


/* Subject Cards dynamically generated */
.subject-card {
    margin-bottom: 12px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
}

.subject-card.danger-card {
    background: linear-gradient(145deg, rgba(82, 19, 19, 0.7), rgba(45, 12, 12, 0.4));
    border: 1px solid rgba(239, 68, 68, 0.5);
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.2);
}

.subject-card.warn-card {
    background: linear-gradient(145deg, rgba(82, 60, 19, 0.6), rgba(45, 30, 12, 0.3));
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.subject-card:hover,
.subject-card:active {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.subject-info h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.subject-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.subject-stats {
    text-align: right;
}

.subject-stats .percentage {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.perc-good {
    color: var(--success-color) !important;
}

.perc-warn {
    color: var(--warning-color) !important;
}

.perc-danger {
    color: var(--danger-color) !important;
}

/* Tabs */
.tabs {
    background: rgba(15, 23, 42, 0.6);
    border-radius: var(--border-radius-md);
    padding: 6px;
    display: flex;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tab-btn {
    flex: 1;
    padding: 10px 0;
    text-align: center;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary-color), #5b21b6);
    color: white;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.tab-btn:not(.active):hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

/* Report Actions */
.report-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.btn-large {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    gap: 12px;
    border-radius: var(--border-radius-md);
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.6));
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    width: 100%;
}

.btn-large i {
    font-size: 1.5rem;
}

.btn-large .btn-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.btn-large .btn-text span {
    font-size: 0.9rem;
    font-weight: 600;
}

.btn-large small {
    font-size: 0.75rem;
    opacity: 0.7;
    font-weight: 400;
}

.btn-large {
    padding: 1.25rem !important;
}

.btn-large i {
    font-size: 1.25rem !important;
    padding: 10px !important;
    border-radius: 50%;
}

.btn-danger i {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.2);
}

.btn-success i {
    color: #6ee7b7;
    background: rgba(16, 185, 129, 0.2);
}

.btn-danger:hover,
.btn-danger:active {
    background: linear-gradient(145deg, rgba(239, 68, 68, 0.3), rgba(185, 28, 28, 0.5));
    border-color: rgba(239, 68, 68, 0.5);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.3);
}

.btn-success:hover,
.btn-success:active {
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.3), rgba(4, 120, 87, 0.5));
    border-color: rgba(16, 185, 129, 0.5);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    letter-spacing: 1px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--surface-border);
}

.divider span {
    padding: 0 10px;
}

/* Progress bar */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary-color);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Toast */
.toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.95);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid var(--surface-border);
    font-size: 0.9rem;
    white-space: nowrap;
}

.toast.show {
    bottom: 24px;
}

/* Install Banner */
.install-banner {
    position: fixed;
    bottom: 16px;
    left: 16px;
    right: 16px;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--surface-color);
    border: 1px solid var(--primary-color);
    box-shadow: 0 10px 40px rgba(139, 92, 246, 0.3);
    border-radius: var(--border-radius-md);
    transform: translateY(150%);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.install-banner.show {
    transform: translateY(0);
}

.install-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.install-info i {
    font-size: 1.8rem;
    color: var(--primary-color);
    background: rgba(139, 92, 246, 0.2);
    padding: 8px;
    border-radius: 50%;
}

.install-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

@media (min-width: 480px) {
    .install-banner {
        width: 448px;
        left: 50%;
        transform: translateX(-50%) translateY(150%);
    }

    .install-banner.show {
        transform: translateX(-50%) translateY(0);
    }
}

/* Footer */
.made-with-love {
    text-align: center;
    padding: 32px 0 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.7;
    margin-top: auto;
}

.made-with-love i {
    color: var(--danger-color);
    margin: 0 2px;
    font-size: 0.9rem;
    vertical-align: middle;

}

/* Theory/Practical Split Styles */
.tracking-sections {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.tracking-section {
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--border-radius-md);
    padding: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.tracking-section h4 {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 0.5rem;
}

.flex-1 {
    flex: 1;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

.border-bottom {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.pb-1 {
    padding-bottom: 0.25rem;
}

/* 3rd Sem MBBS Specific Styling */
.badge-group {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.badge-primary {
    background: rgba(139, 92, 246, 0.2);
    color: #c084fc;
    border: 1px solid rgba(139, 92, 246, 0.4);
}

.badge-secondary {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.badge-accent {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

/* Clinic Hero Card */
.clinic-banner {
    position: relative;
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.95));
    border: 1px solid rgba(139, 92, 246, 0.3);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.15);
}

.clinic-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--primary-color);
    background: rgba(139, 92, 246, 0.15);
    padding: 4px 10px;
    border-radius: 12px;
}

.clinic-progress-bar {
    height: 6px;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.clinic-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
    border-radius: 10px;
    transition: width 0.5s ease;
}

/* Today Schedule Timeline */
.today-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.timeline-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: var(--transition);
}

.timeline-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.timeline-time {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
    min-width: 90px;
}

.timeline-content {
    flex: 1;
    margin: 0 12px;
}

.timeline-title {
    font-size: 0.875rem;
    font-weight: 600;
}

.type-pill {
    display: inline-block;
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 2px;
}

.type-pill.theory {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.type-pill.practical {
    background: rgba(236, 72, 153, 0.2);
    color: #f472b6;
}

.type-pill.clinic {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

/* Timetable Selector */
.day-selector {
    gap: 4px;
}

.day-btn {
    flex: 1;
    padding: 8px 0;
    font-size: 0.8rem;
    font-weight: 600;
    background: transparent;
    border: none;
    color: var(--text-muted);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.day-btn.active, .day-btn:hover {
    background: var(--primary-color);
    color: white;
}

.rotation-step {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.rotation-step.active-step {
    background: rgba(139, 92, 246, 0.12);
    border-color: rgba(139, 92, 246, 0.4);
}

/* Bottom Navigation Toolbar */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: 64px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
}

.nav-item {
    background: transparent;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-center: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    width: 33%;
    padding: 6px 0;
}

.nav-item i {
    font-size: 1.35rem;
}

.nav-item.active {
    color: var(--primary-color);
}

/* Adjust view padding for bottom nav */
.view {
    padding-bottom: 80px;
}