:root {
    /* Color Palette */
    --bg-base: #0f111a;
    --bg-glass: rgba(30, 32, 45, 0.7);
    --bg-glass-hover: rgba(45, 48, 65, 0.8);
    --border-glass: rgba(255, 255, 255, 0.08);
    
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --secondary: #3b82f6;
    --danger: #ef4444;
    --success: #10b981;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --wheel-1: #f43f5e;
    --wheel-2: #f59e0b;
    --wheel-3: #10b981;
    --wheel-4: #3b82f6;
    --wheel-5: #8b5cf6;
    --wheel-6: #ec4899;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(at 0% 0%, rgba(139, 92, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(59, 130, 246, 0.15) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Utils */
.w-full { width: 100%; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.pt-4 { padding-top: 1rem; }
.border-t { border-top: 1px solid var(--border-glass); }
.flex-row { display: flex; gap: 0.5rem; align-items: center; }

/* Glassmorphism */
.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 1.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* Typography */
h1, h2, h3 { font-weight: 600; }
h1 { font-size: 1.5rem; letter-spacing: -0.02em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 1rem; }

/* Buttons & Inputs */
button {
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    outline: none;
}
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #a855f7);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}
.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-glass);
}
.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-icon {
    background: transparent;
    color: var(--text-main);
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}
.btn-icon:hover { background: rgba(255,255,255,0.1); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.9rem; }

.input-modern, select.input-modern {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-glass);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-size: 1rem;
    transition: all 0.2s;
}
.input-modern:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
    outline: none;
}
select.input-modern option {
    background: var(--bg-base);
    color: white;
}

/* Layout */
.app-container {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.top-nav {
    position: sticky;
    top: 0;
    z-index: 40;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-glass);
}
.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-content {
    max-width: 1200px;
    margin: 2rem auto;
    width: 100%;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
}

/* Wheels Section */
.wheels-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.wheel-card {
    padding: 1.5rem;
    border-radius: 1.5rem;
}
.wheel-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.wheel-item {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-glass);
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.wheel-item.next-up {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.5);
    transform: scale(1.02);
}
.wheel-item.animating-out {
    opacity: 0;
    transform: translateX(-20px);
}
.wheel-item.animating-in {
    opacity: 0;
    transform: translateX(20px);
}
.avatar-circle {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
}
.wheel-item.next-up .avatar-circle {
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.5);
}
.item-name {
    font-weight: 500;
    font-size: 1.1rem;
}
.next-badge {
    margin-left: auto;
    font-size: 0.75rem;
    background: var(--primary);
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
    font-weight: 600;
}

/* Calendar Section */
.calendar-section {
    border-radius: 1.5rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}
.calendar-day {
    aspect-ratio: 1;
    border-radius: 1rem;
    border: 1px solid var(--border-glass);
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}
.calendar-day.weekday {
    background: rgba(0,0,0,0.1);
}
.calendar-day.weekend {
    background: rgba(255,255,255,0.03);
}
.calendar-day.holiday-day {
    background: rgba(244, 63, 94, 0.05);
}
.calendar-day:hover:not(.other-month) {
    background: rgba(255,255,255,0.08);
    transform: translateY(-2px);
}
.calendar-day.other-month {
    opacity: 0.3;
    pointer-events: none;
}
.calendar-day.today {
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.1);
}
.day-number {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.day-status {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 0.5rem;
    padding: 0.25rem;
}
.status-simona {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}
.status-holiday {
    background: rgba(244, 63, 94, 0.15);
    color: #fb7185;
    border: 1px solid rgba(244, 63, 94, 0.5);
}
.status-holiday-pending {
    background: rgba(244, 63, 94, 0.1);
    color: #fb7185;
    border: 1px dashed rgba(244, 63, 94, 0.5);
}
.status-assigned {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}
.status-available {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px dashed rgba(245, 158, 11, 0.5);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.modal-card {
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    transform: scale(0.95) translateY(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-body {
    overflow-y: auto;
    padding-right: 0.5rem; /* prevent scrollbar from hiding content */
}
.modal-body::-webkit-scrollbar {
    width: 6px;
}
.modal-body::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}
.settings-card {
    max-width: 500px;
}
.modal-overlay.active .modal-card {
    transform: scale(1) translateY(0);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.modal-date {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}
.assign-section {
    background: rgba(0,0,0,0.2);
    padding: 1rem;
    border-radius: 1rem;
    border: 1px solid var(--border-glass);
}
.next-up-text {
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}
.next-up-text strong {
    color: var(--primary);
    font-size: 1.25rem;
}
.hint-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 0.5rem;
}
.pulse-btn {
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(139, 92, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0); }
}
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--text-muted);
}
.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-glass);
}
.divider span { padding: 0 1rem; font-size: 0.9rem; }

/* Settings */
.settings-group {
    margin-bottom: 1.5rem;
}
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.user-tag {
    background: rgba(255,255,255,0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}
.btn-remove-tag {
    background: none; border: none; color: #fca5a5; cursor: pointer;
}
.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
.stat-card {
    background: rgba(0,0,0,0.2);
    padding: 1rem;
    border-radius: 1rem;
    border: 1px solid var(--border-glass);
}
.stat-card h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}
.stat-card p {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}
.sortable-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.sortable-item {
    background: rgba(0,0,0,0.2);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 1000;
}
.toast {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.toast.error { border-left: 4px solid var(--danger); }
.toast.success { border-left: 4px solid var(--success); }
.toast.fade-out { animation: slideOut 0.3s forwards; }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes slideOut {
    to { transform: translateX(100%); opacity: 0; }
}

/* Login */
.login-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-base);
    z-index: 999;
}
.login-card {
    padding: 2rem;
    width: 90%;
    max-width: 350px;
    text-align: center;
}
.login-header h2 {
    margin-bottom: 1.5rem;
}
.login-card form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.error-text { color: #fca5a5; font-size: 0.9rem; }

/* Responsive */
@media (max-width: 900px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    .wheels-section {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }
    .wheel-card {
        min-width: 280px;
        flex: 1;
    }
    .calendar-day {
        aspect-ratio: auto;
        min-height: 70px;
        padding: 0.25rem;
    }
    .day-number { font-size: 0.9rem; }
    .day-status { font-size: 0.7rem; padding: 0.1rem; }
}
