:root {
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --success: #10b981;
    --danger: #ef4444;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 2rem;
    line-height: 1.6;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Upload Section */
.upload-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.file-input {
    display: none;
}

.upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.file-name {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Filters */
.hidden {
    display: none !important;
}

.main-content-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.filter-section {
    flex: 0 0 300px;
    position: sticky;
    top: 2rem;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
}

.filter-section::-webkit-scrollbar {
    width: 6px;
}

.filter-section::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

@media (max-width: 1024px) {
    .main-content-layout {
        flex-direction: column;
    }

    .filter-section {
        flex: auto;
        width: 100%;
        position: static;
        max-height: none;
    }
}

.filter-section h2 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin: 0;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    margin-bottom: 1rem;
    user-select: none;
}

.filter-header:hover h2 {
    color: var(--accent);
}

.filter-header .chevron {
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.filter-group.collapsed .chevron {
    transform: rotate(180deg);
}

.filter-group.collapsed .chips-container {
    display: none;
}

.filter-group.collapsed .filter-header {
    margin-bottom: 0;
}

.chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.search-wrapper {
    position: relative;
    margin-bottom: 1rem;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.filter-search {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 0.5rem;
    color: var(--text-primary);
    padding: 0.6rem 0.75rem 0.6rem 2.25rem;
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.filter-search::placeholder {
    color: var(--text-secondary);
}

.filter-search:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
}

.chip.hidden-by-search {
    display: none;
}

.vak-filter-body {
    display: flex;
    flex-direction: column;
}

.filter-group.collapsed .vak-filter-body {
    display: none;
}

.vak-search-wrapper {
    position: relative;
    margin-bottom: 0.75rem;
}

.vak-suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid var(--card-border);
    border-radius: 0.5rem;
    max-height: 240px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.vak-suggestion {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.vak-suggestion:last-child {
    border-bottom: none;
}

.vak-suggestion:hover {
    background: rgba(99, 102, 241, 0.25);
}

.vak-suggestion.disabled {
    color: var(--text-secondary);
    cursor: default;
    font-style: italic;
}

.vak-suggestion.disabled:hover {
    background: transparent;
}

.vak-suggestions-more {
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-style: italic;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.filter-group.no-search-matches {
    display: none;
}

.chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    user-select: none;
}

.chip:hover {
    background: rgba(255, 255, 255, 0.1);
}

.chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.secondary-btn {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

/* Calendar Grid */
.calendar-container {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    margin-bottom: 3rem;
}

.week-view {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.week-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #cbd5e1;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 0.5rem;
}

.days-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    /* Monday to Friday */
    gap: 1rem;
}

@media (max-width: 1024px) {
    .days-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .days-grid {
        grid-template-columns: 1fr;
    }
}

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

.day-header {
    text-align: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0.5rem;
    font-weight: 600;
}

.day-header .date {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Exam Cards */
.exam-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 0.75rem;
    padding: 1rem;
    transition: transform 0.2s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

.exam-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.08);
}

.exam-time {
    font-size: 0.8rem;
    color: #818cf8;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.exam-subject {
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.3;
    color: white;
}

.exam-detail {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.exam-detail svg {
    flex-shrink: 0;
    margin-top: 0.1rem;
    color: var(--text-secondary);
}

.card-header {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
    padding-right: 2rem;
}

.expand-icon {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    color: var(--text-secondary);
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.exam-card.expanded .expand-icon {
    transform: translateY(-50%) rotate(180deg);
}

.card-body {
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--card-border);
    animation: fadeIn 0.3s ease;
}

.exam-card.expanded .card-body {
    display: flex;
}

.word-wrap {
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    line-height: 1.4;
}

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

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

/* Loading */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Help Button */
.help-btn {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--card-border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: auto;
}

.help-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: var(--text-primary);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    display: none !important;
}

.modal-content {
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--card-border);
}

.modal-header h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

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

.modal-body h3 {
    color: var(--accent);
    margin: 1.5rem 0 0.5rem 0;
    font-size: 1.1rem;
}

.modal-body p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.modal-body ul {
    list-style-type: none;
    margin-bottom: 1rem;
}

.modal-body li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.modal-body li:last-child {
    border-bottom: none;
}

.modal-body li strong {
    color: var(--text-primary);
    display: inline-block;
    min-width: 100px;
}