:root {
    --bg-color: #030508;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
    --accent-primary: #6366f1;
    --accent-secondary: #a855f7;
    --accent-hover: #4f46e5;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --danger: #ff4d4d;
    --warning: #ffb347;
    --success: #00e676;
    --glass-blur: 16px;
    --progress-bg: rgba(255, 255, 255, 0.05);
    --stat-gradient-1: #ffffff;
    --stat-gradient-2: #cbd5e1;
}

[data-theme="light"] {
    --bg-color: #f1f5f9;
    --card-bg: rgba(255, 255, 255, 0.6);
    --card-border: rgba(0, 0, 0, 0.05);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --progress-bg: rgba(0, 0, 0, 0.03);
    --stat-gradient-1: #0f172a;
    --stat-gradient-2: #475569;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* Background Animated Blobs */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    filter: blur(80px);
    opacity: 0.4;
    transition: opacity 0.5s ease;
}

[data-theme="light"] .background-blobs {
    opacity: 0.15;
}

.blob {
    position: absolute;
    border-radius: 50%;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: var(--accent-primary);
    top: -100px;
    left: -100px;
    animation: move 20s infinite alternate;
}

.blob-2 {
    width: 300px;
    height: 300px;
    background: #a855f7;
    bottom: -50px;
    right: -50px;
    animation: move 25s infinite alternate-reverse;
}

.blob-3 {
    width: 250px;
    height: 250px;
    background: #3b82f6;
    top: 40%;
    left: 50%;
    animation: move 15s infinite linear;
}

@keyframes move {
    from {
        transform: translate(0, 0);
    }

    to {
        transform: translate(100px, 100px);
    }
}

/* App Container */
.app-container {
    width: 100%;
    max-width: 900px;
    z-index: 1;
}

.header {
    text-align: center;
    margin-bottom: 4rem;
    padding-top: 2rem;
}

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

@media (max-width: 600px) {
    .header-top {
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    #theme-toggle {
        position: fixed;
        top: 1.2rem;
        right: 1.2rem;
        z-index: 1000;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    }
}

.btn-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    backdrop-filter: blur(10px);
    z-index: 10;
}

.btn-icon:hover {
    background: var(--accent-primary);
    color: white;
    transform: rotate(15deg) scale(1.1);
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.btn-icon i {
    width: 20px;
    height: 20px;
}

/* Navigation */
.app-nav {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
    margin-bottom: 2.5rem;
    position: sticky;
    top: 1rem;
    z-index: 1000;
    border-radius: 20px;
    max-width: fit-content;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.nav-item {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.8rem 1.5rem;
    border-radius: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 600px) {
    .app-nav {
        position: fixed;
        bottom: 1.5rem;
        top: auto;
        left: 1rem;
        right: 1rem;
        max-width: none;
        padding: 0.75rem;
        gap: 0.25rem;
        border-radius: 24px;
        background: rgba(255, 255, 255, 0.08);
        backdrop-filter: blur(20px);
    }

    .nav-item {
        flex: 1;
        flex-direction: column;
        gap: 0.25rem;
        padding: 0.5rem;
        font-size: 0.7rem;
    }

    .nav-item i {
        width: 20px;
        height: 20px;
    }

    .app-container {
        padding-bottom: 8rem;
        /* Space for bottom nav */
    }
}

.nav-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    background: var(--accent-primary);
    color: white;
    box-shadow: 0 8px 20px -5px var(--accent-primary);
}

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

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

.title {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 900;
    letter-spacing: -2px;
    margin-bottom: 1rem;
    line-height: 1;
}

.accent {
    background: linear-gradient(135deg, #818cf8 0%, #c084fc 50%, #6366f1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.3));
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.2rem;
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto;
}

/* Input Section */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--card-border);
    border-radius: 24px;
}

.input-section {
    padding: 1.5rem;
    margin-bottom: 3rem;
    box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.5);
    border-radius: 28px;
}

.input-group {
    display: flex;
    gap: 0.75rem;
}

@media (max-width: 768px) {
    .input-group {
        flex-direction: column;
    }
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1.25rem;
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}

input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 0.8rem 1rem 0.8rem 3rem;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

input:focus {
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0.8rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -10px var(--accent-primary);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Exams List */
.exams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.exam-card {
    padding: 1.75rem;
    position: relative;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    overflow: hidden;
}

.exam-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.05), transparent);
    pointer-events: none;
}

.exam-card:hover {
    transform: translateY(-10px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.exam-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    word-break: break-word;
}

.btn-delete {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-delete:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.countdown-display {
    display: flex;
    gap: 1rem;
    margin-top: auto;
}

.time-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.time-val {
    font-size: 1.5rem;
    font-weight: 700;
}

.time-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

/* Urgency Status Styles */
/* Progress Bar */
.progress-container {
    width: 100%;
    height: 6px;
    background: var(--progress-bg);
    border-radius: 3px;
    margin: 1.5rem 0;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.status-urgent .progress-bar {
    background: var(--danger);
}

.status-soon .progress-bar {
    background: var(--warning);
}

.status-far .progress-bar {
    background: var(--success);
}

.status-indicator {
    height: 4px;
    width: 40px;
    border-radius: 2px;
    margin-top: 1rem;
}

.status-urgent .status-indicator {
    background: var(--danger);
    box-shadow: 0 0 12px var(--danger);
}

.status-soon .status-indicator {
    background: var(--warning);
    box-shadow: 0 0 12px var(--warning);
}

.status-far .status-indicator {
    background: var(--success);
    box-shadow: 0 0 12px var(--success);
}

.urgent-badge {
    position: absolute;
    top: 0;
    left: 0;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 6px 16px;
    border-bottom-right-radius: 16px;
    text-transform: uppercase;
    z-index: 10;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    margin-top: 2rem;
}

.empty-icon-wrapper {
    background: rgba(99, 102, 241, 0.1);
    width: 64px;
    height: 64px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.empty-icon {
    color: var(--accent-primary);
    width: 32px;
    height: 32px;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.exam-card {
    animation: fadeIn 0.5s ease forwards;
}

.exam-card.passed {
    opacity: 0.7;
    filter: grayscale(0.5);
}

.exam-card.passed .time-val {
    color: var(--text-secondary);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    animation: slideInUp 0.3s ease forwards;
}

.toast-success {
    background: var(--success);
}

.toast-info {
    background: var(--accent-primary);
}

@keyframes slideInUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Dashboard & Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border-radius: 32px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.stat-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.4);
}

.stat-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--stat-gradient-1) 0%, var(--stat-gradient-2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-value.small {
    font-size: 1.1rem;
}

.text-urgent {
    background: none;
    -webkit-text-fill-color: initial;
    color: var(--danger);
}

/* Reminders */
.reminders-container {
    padding: 1.5rem;
}

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

.reminders-list {
    list-style: none;
}

.reminder-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.reminder-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

/* Planner */
.planner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.planner-day {
    padding: 2rem;
    min-height: 240px;
    border-radius: 32px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    transition: all 0.4s ease;
}

.planner-day:hover {
    background: rgba(255, 255, 255, 0.04);
}

.day-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.day-title small {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.planner-exam-item {
    font-size: 0.85rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--accent-primary), #a855f7);
    color: white;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.2);
    font-weight: 500;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    padding: 2rem;
    width: 90%;
    max-width: 400px;
}

.modal h3 {
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
}

.btn-icon.small {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}