:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(15, 23, 42, 0.6);
    --input-border: rgba(255, 255, 255, 0.15);
    --input-focus: rgba(99, 102, 241, 0.5);
    --error-color: #ef4444;
    --success-color: #10b981;
    --day-mon: #6366f1;
    --day-tue: #ec4899;
    --day-wed: #f59e0b;
    --day-thu: #10b981;
    --day-fri: #3b82f6;
}

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

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

/* Background Animated Blobs */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.blob {
    position: absolute;
    filter: blur(100px);
    border-radius: 50%;
    opacity: 0.4;
    animation: float 12s infinite ease-in-out alternate;
}

.blob-1 { top: -15%; left: -10%; width: 400px; height: 400px; background: #4f46e5; }
.blob-2 { bottom: -15%; right: -10%; width: 500px; height: 500px; background: #c026d3; animation-delay: -4s; }
.blob-3 { top: 40%; left: 50%; width: 350px; height: 350px; background: #0ea5e9; animation-delay: -8s; }

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(80px, 40px) scale(1.15); }
}

.form-container {
    width: 100%;
    max-width: 680px;
    animation: fadeUp 0.6s ease-out forwards;
}

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

.form-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.form-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.form-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.glass-form {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 32px;
    padding: 3rem;
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.6);
}

.form-group { margin-bottom: 2.5rem; }
.form-group > label { display: block; font-weight: 700; margin-bottom: 0.75rem; font-size: 1.1rem; color: #fff; }
.required { color: var(--error-color); }
.helper-text { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 1.5rem; margin-top: -0.25rem; }
.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--card-border), transparent); margin: 2.5rem 0; }

input[type="text"], select {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-color);
    border-radius: 14px;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    outline: none;
}

input[type="text"]:focus, select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--input-focus);
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2em;
    padding-right: 2.5rem;
    cursor: pointer;
}

/* Day Section - Always Visible */
.days-accordion {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.day-section {
    border: 1px solid var(--input-border);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.02);
    padding: 1.5rem;
}

.day-label {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.day-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    color: white;
}

.day-name { font-weight: 700; font-size: 1.1rem; letter-spacing: 0.05em; color: #fff; }

.day-section[data-day="Monday"] .day-icon { background: var(--day-mon); }
.day-section[data-day="Tuesday"] .day-icon { background: var(--day-tue); }
.day-section[data-day="Wednesday"] .day-icon { background: var(--day-wed); }
.day-section[data-day="Thursday"] .day-icon { background: var(--day-thu); }
.day-section[data-day="Friday"] .day-icon { background: var(--day-fri); }

/* Class Entry (Group) */
.class-entry {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--input-border);
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    animation: fadeIn 0.3s ease-out;
}

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

.entry-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.entry-tags:empty { margin-bottom: 0; }

.class-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: #a5b4fc;
    padding: 0.4rem 0.8rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
}

.class-tag button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    display: flex;
    padding: 0;
    opacity: 0.7;
}

.class-tag button:hover { opacity: 1; }

/* Custom Multi-Select Dropdown */
.multi-select-container {
    position: relative;
    flex: 1;
}

.multi-select-trigger {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-color);
    border-radius: 14px;
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s;
    min-height: 52px;
}

.multi-select-trigger:after {
    content: '';
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg);
    margin-right: 4px;
    margin-top: -4px;
}

.multi-select-trigger.open {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--input-focus);
}

.multi-select-trigger.open:after {
    transform: rotate(-135deg);
    margin-top: 4px;
}

.multi-select-options {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    background: #1e293b;
    border: 1px solid var(--card-border);
    border-radius: 16px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    padding: 0.5rem;
}

.multi-select-options.visible {
    display: block;
    animation: slideDown 0.2s ease-out;
}

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

.multi-select-option {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
}

.multi-select-option:hover {
    background: rgba(255, 255, 255, 0.05);
}

.multi-select-option input {
    margin-right: 0.75rem;
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.multi-select-option span {
    font-size: 0.95rem;
    color: var(--text-color);
}

.selected-count-badge {
    background: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
}

.entry-controls {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.remove-entry-btn {
    width: 48px;
    height: 48px;
    min-width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.remove-entry-btn:hover { background: var(--error-color); color: white; }

.add-entry-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: transparent;
    border: 2px dashed var(--input-border);
    color: var(--text-muted);
    padding: 1rem;
    border-radius: 14px;
    width: 100%;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

.add-entry-btn:hover { border-color: var(--primary-color); color: var(--primary-color); background: rgba(99, 102, 241, 0.05); }

/* Day-specific tag highlights */
.day-section[data-day="Monday"] .class-tag { background: rgba(99, 102, 241, 0.2); border-color: rgba(99, 102, 241, 0.4); color: #a5b4fc; }
.day-section[data-day="Tuesday"] .class-tag { background: rgba(236, 72, 153, 0.2); border-color: rgba(236, 72, 153, 0.4); color: #f9a8d4; }
.day-section[data-day="Wednesday"] .class-tag { background: rgba(245, 158, 11, 0.2); border-color: rgba(245, 158, 11, 0.4); color: #fcd34d; }
.day-section[data-day="Thursday"] .class-tag { background: rgba(16, 185, 129, 0.2); border-color: rgba(16, 185, 129, 0.4); color: #6ee7b7; }
.day-section[data-day="Friday"] .class-tag { background: rgba(59, 130, 246, 0.2); border-color: rgba(59, 130, 246, 0.4); color: #93c5fd; }

.error-message { color: var(--error-color); font-size: 0.9rem; margin-top: 1rem; display: none; font-weight: 500; }
.error-message.visible { display: block; animation: shake 0.4s; }

@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

.submit-btn {
    width: 100%;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1.25rem;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s;
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
    font-family: inherit;
}

.submit-btn:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 15px 30px rgba(99, 102, 241, 0.6); }
.submit-btn:active { transform: translateY(0); }

@media (max-width: 640px) {
    .glass-form { padding: 1.5rem; border-radius: 24px; }
    .form-header h1 { font-size: 1.8rem; }
    .entry-controls { flex-direction: column; align-items: stretch; }
    .remove-entry-btn { width: 100%; }
}
