@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-color: #f4f7fe;
    --card-bg: #ffffff;
    --text-main: #2b3674;
    --text-sec: #a3aed1;
    --primary: #4318FF;
    --primary-hover: #3311db;
    --nav-bg: rgba(255, 255, 255, 0.7);
    --border-color: #e2e8f0;
    --shadow: 0px 10px 30px rgba(0, 0, 0, 0.05);
    --danger: #ef4444;
    --success: #22c55e;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.dark {
    --bg-color: #0b1437;
    --card-bg: #111c44;
    --text-main: #ffffff;
    --text-sec: #8f9bba;
    --nav-bg: rgba(17, 28, 68, 0.7);
    --border-color: #2b3674;
    --shadow: 0px 10px 30px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: var(--bg-color);
    color: var(--text-main);
    transition: background 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
}

nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 16px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 30px;
}

.brand {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #4318FF 0%, #868CFF 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-links a {
    color: var(--text-sec);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: var(--transition);
    position: relative;
    padding: 4px 0;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-main);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary);
    border-radius: 4px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.themeToggle {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: var(--transition);
}

.themeToggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow);
}

.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-main);
    cursor: pointer;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 40px auto;
    animation: fadeIn 0.5s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0px 20px 40px rgba(0, 0, 0, 0.08);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
    opacity: 0;
    transition: var(--transition);
}

.card:hover::before {
    opacity: 1;
}

h1,
h2,
h3 {
    color: var(--text-main);
    margin-bottom: 16px;
    font-weight: 700;
}

p {
    color: var(--text-sec);
    line-height: 1.6;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-main);
    font-size: 14px;
}

input,
select {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 15px;
    transition: var(--transition);
    appearance: none;
}

select {
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232b3674' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    padding-right: 2.5rem;
}

.dark select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

input[type="time"],
input[type="date"] {
    color: var(--text-main);
}

input:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 24, 255, 0.15);
    outline: none;
}

button.btn-primary {
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, #868CFF 100%);
    border: none;
    color: white;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
}

button.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(67, 24, 255, 0.3);
}

button.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

button.btn-danger:hover {
    background: var(--danger);
    color: white;
}

button.btn-success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

button.btn-success:hover {
    background: var(--success);
    color: white;
}

.list-item {
    background: var(--bg-color);
    padding: 18px 20px;
    border-radius: 14px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.list-item:hover {
    border-color: var(--primary);
    transform: translateX(4px);
}

.list-item-content h4 {
    margin: 0 0 6px 0;
    font-size: 16px;
    color: var(--text-main);
}

.list-item-content p {
    margin: 0;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-low {
    background: rgba(56, 189, 248, 0.1);
    color: #0ea5e9;
}

.badge-medium {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.badge-high {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.timetable-day {
    margin-bottom: 24px;
}

.timetable-day h3 {
    font-size: 18px;
    color: var(--primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.timetable-slot {
    background: var(--bg-color);
    padding: 12px 16px;
    margin-bottom: 10px;
    border-radius: 10px;
    display: grid;
    grid-template-columns: 80px 1fr auto;
    align-items: center;
    gap: 16px;
    border-left: 4px solid var(--primary);
}

.slot-time {
    font-weight: 700;
    color: var(--text-main);
}

.slot-subject {
    font-weight: 500;
    color: var(--text-sec);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
}

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

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.primary {
    background: rgba(67, 24, 255, 0.1);
    color: var(--primary);
}

.stat-icon.success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.stat-icon.danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.stat-info h4 {
    color: var(--text-sec);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-info h2 {
    color: var(--text-main);
    font-size: 28px;
    margin: 0;
}

#toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--card-bg);
    color: var(--text-main);
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid var(--primary);
    animation: slideInRight 0.3s ease forwards;
    opacity: 0;
    transform: translateX(100%);
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

@keyframes slideInRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--card-bg);
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
        border-top: 1px solid var(--border-color);
    }

    .nav-links.show {
        display: flex;
    }

    .hamburger {
        display: block;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .timetable-slot {
        grid-template-columns: 1fr;
        text-align: center;
    }
}