:root {
    --bg: #0b1121;
    --glass: rgba(30, 41, 59, 0.7);
    --glass-solid: rgba(30, 41, 59, 0.95);
    --border: rgba(255, 255, 255, 0.08);
    --accent: #f05a28;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --radius: 20px;
    --shadow: 0 10px 40px -10px rgba(0,0,0,0.5);
    
    /* Calendar Colors */
    --fc-border-color: rgba(255, 255, 255, 0.1);
    --fc-page-bg-color: transparent;
    --fc-neutral-bg-color: rgba(255,255,255,0.05);
    --fc-list-event-hover-bg-color: rgba(255,255,255,0.1);
    --fc-today-bg-color: rgba(240, 90, 40, 0.15) !important;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* Background */
.app-background { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.4; }
.orb-1 { top: -10%; left: -10%; width: 50vw; height: 50vw; background: #4f46e5; animation: float 10s ease-in-out infinite alternate; }
.orb-2 { bottom: -10%; right: -10%; width: 60vw; height: 60vw; background: var(--accent); animation: float 12s ease-in-out infinite alternate-reverse; }
@keyframes float { to { transform: translate(30px, 30px); } }

/* Layout */
.app-layout { display: flex; max-width: 1200px; margin: 0 auto; min-height: 100vh; }
.content-area { flex: 1; padding: 24px; padding-bottom: 100px; max-width: 100%; }

/* Navigation */
.glass-nav {
    width: 250px; padding: 30px 20px; background: var(--glass); backdrop-filter: blur(20px);
    border-right: 1px solid var(--border); position: sticky; top: 0; height: 100vh;
    display: flex; flex-direction: column; z-index: 100;
}
.nav-brand { font-size: 24px; font-weight: 800; letter-spacing: 2px; color: var(--accent); margin-bottom: 40px; text-align: center; }
.tab-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.tab-links a { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: var(--text-muted); text-decoration: none; font-weight: 500; border-radius: 12px; transition: 0.2s; cursor: pointer; }
.tab-links svg { width: 20px; height: 20px; }
.tab-links li.active a { background: var(--accent); color: white; box-shadow: 0 4px 20px rgba(240, 90, 40, 0.4); }
.tab-links li:not(.active) a:hover { background: rgba(255,255,255,0.05); color: white; }
.tab-links li.disabled { opacity: 0.5; pointer-events: none; }

/* Tabs */
.tab { display: none; animation: fadeEffect 0.3s; }
.tab.active { display: block; }
@keyframes fadeEffect { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.glass-header h1 { font-size: 28px; margin: 0 0 24px; }
.schedule-header { display: flex; justify-content: space-between; align-items: center; }
.small-btn { padding: 8px 16px; font-size: 14px; }

/* Cards */
.glass-card { background: var(--glass); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; backdrop-filter: blur(12px); margin-bottom: 16px; box-shadow: var(--shadow); }
.accent-border { border-left: 3px solid var(--accent); }

/* Profile */
.profile-flex { display: flex; align-items: center; gap: 20px; }
.photo-wrapper { position: relative; }
.photo-wrapper img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,0.2); }
.status-dot { width: 12px; height: 12px; background: #10b981; border-radius: 50%; position: absolute; bottom: 5px; right: 0; border: 2px solid var(--bg); }
.profile-text h2 { margin: 0; font-size: 20px; }
.user-email { color: var(--text-muted); font-size: 14px; margin: 4px 0 10px; }
.tags { display: flex; gap: 8px; }
.tag { background: rgba(255,255,255,0.1); padding: 4px 10px; border-radius: 20px; font-size: 12px; }

/* Sub Tabs */
.sub-nav-wrapper { margin: 20px 0; }
.sub-tab-links { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.sub-tab-links a { display: block; padding: 8px 16px; background: rgba(255,255,255,0.05); border: 1px solid var(--border); color: var(--text-muted); text-decoration: none; border-radius: 20px; font-size: 13px; font-weight: 500; }
.sub-tab-links li.active a { background: white; color: black; border-color: white; }
.sub-tab { display: none; }
.sub-tab.active { display: block; }

/* Sub Content */
.info-card { display: flex; align-items: center; gap: 15px; }
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.product-item .prod-head { display: flex; justify-content: space-between; margin-bottom: 10px; }
.price-badge { color: var(--accent); font-weight: bold; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 15px; font-size: 12px; }
.stats-grid div { display: flex; flex-direction: column; background: rgba(0,0,0,0.2); padding: 8px; border-radius: 8px; }
.stats-grid span { color: var(--text-muted); margin-bottom: 2px; }
.clubs-wrapper { display: flex; gap: 10px; flex-wrap: wrap; }
.club-card { text-align: center; min-width: 120px; }
.club-val { display: block; font-size: 24px; font-weight: bold; color: var(--accent); }

/* Credit Card */
.credit-card { background: linear-gradient(135deg, #f05a28, #c2410c); border-radius: 20px; padding: 24px; color: white; position: relative; overflow: hidden; max-width: 340px; margin: 0 auto; box-shadow: 0 20px 50px rgba(240, 90, 40, 0.3); }
.card-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0IiBoZWlnaHQ9IjQiPgo8cmVjdCB3aWR0aD0iNCIgaGVpZ2h0PSI0IiBmaWxsPSIjZmZmIiBmaWxsLW9wYWNpdHk9IjAuMSIvPgo8L3N2Zz4='); opacity: 0.3; }
.card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.card-num { font-size: 22px; letter-spacing: 2px; margin-bottom: 30px; font-family: monospace; text-shadow: 0 2px 2px rgba(0,0,0,0.2); }
.card-bottom { display: flex; justify-content: space-between; text-transform: uppercase; font-size: 10px; }
.card-bottom .val { display: block; font-size: 14px; font-weight: bold; margin-top: 4px; }

/* Payments */
.contract-title { font-size: 14px; color: var(--text-muted); margin: 20px 0 10px; text-transform: uppercase; letter-spacing: 1px; }
.payment-card { display: flex; align-items: center; gap: 16px; padding: 16px; cursor: pointer; transition: 0.2s; user-select: none; }
.payment-card:active { transform: scale(0.98); }
.pc-check input { display: none; }
.custom-check { width: 24px; height: 24px; border: 2px solid #475569; border-radius: 6px; display: grid; place-items: center; color: transparent; transition: 0.2s; }
.pc-check input:checked + .custom-check { background: var(--accent); border-color: var(--accent); color: white; }
.pc-check input:checked + .custom-check svg { width: 16px; }
.pc-info { flex: 1; }
.pc-desc { font-weight: 500; margin-bottom: 4px; line-height: 1.2; }
.pc-date { font-size: 12px; color: var(--text-muted); }
.pc-amount { font-weight: bold; font-size: 16px; color: white; }

.pay-dock { position: fixed; bottom: 20px; left: 270px; right: 20px; background: var(--glass-solid); border: 1px solid var(--accent); padding: 16px 24px; border-radius: 16px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 10px 40px rgba(0,0,0,0.5); z-index: 90; }
.pay-total { font-size: 18px; font-weight: bold; }
.pay-btn { background: var(--accent); color: white; border: none; padding: 12px 24px; border-radius: 12px; font-weight: 600; font-size: 16px; cursor: pointer; }
.pay-btn.full { width: 100%; margin-top: 20px; }

/* Calendar */
.calendar-wrapper { padding: 10px; min-height: 600px; overflow: hidden; }
#calendar { color: var(--text); font-family: 'Inter', sans-serif; }
.fc-button-primary { background-color: rgba(255,255,255,0.1) !important; border: 1px solid rgba(255,255,255,0.1) !important; color: var(--text) !important; }
.fc-button-primary:hover, .fc-button-active { background-color: var(--accent) !important; border-color: var(--accent) !important; }
.fc-theme-standard th, .fc-theme-standard td { border-color: var(--fc-border-color); }
.fc-event { border: none; background-color: var(--accent); box-shadow: 0 4px 10px rgba(240, 90, 40, 0.4); }

/* Modal */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(5px); z-index: 1000; display: none; justify-content: center; align-items: center; padding: 20px; opacity: 0; transition: opacity 0.3s ease; }
.modal-overlay.open { display: flex; opacity: 1; }
.modal-content { width: 100%; max-width: 400px; background: #1e293b; position: relative; transform: translateY(20px); transition: transform 0.3s ease; }
.modal-overlay.open .modal-content { transform: translateY(0); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.close-btn { background: none; border: none; color: var(--text-muted); font-size: 28px; cursor: pointer; }
.glass-input { width: 100%; padding: 12px; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.2); border-radius: 10px; color: white; margin-top: 5px; font-family: inherit; }
.glass-input:focus { outline: none; border-color: var(--accent); }
.search-group { position: relative; }
.search-dropdown { position: absolute; top: 100%; left: 0; width: 100%; background: #1e293b; border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; margin-top: 5px; max-height: 150px; overflow-y: auto; z-index: 10; display: none; box-shadow: 0 10px 20px rgba(0,0,0,0.5); }
.search-result-item { padding: 10px; cursor: pointer; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 13px; }
.search-result-item:hover { background: var(--accent); color: white; }

/* Login */
.login-box { text-align: center; }
.login-box h2 { margin-bottom: 20px; }

/* Mobile */
@media (max-width: 768px) {
    .app-layout { display: block; }
    .glass-nav { width: 100%; height: auto; position: fixed; bottom: 0; top: auto; flex-direction: row; justify-content: space-around; padding: 10px; border-right: none; border-top: 1px solid var(--border); background: rgba(15, 23, 42, 0.95); }
    .nav-brand { display: none; }
    .tab-links { flex-direction: row; width: 100%; justify-content: space-around; gap: 0; }
    .tab-links a { flex-direction: column; gap: 4px; padding: 8px; font-size: 10px; border-radius: 8px; }
    .tab-links svg { width: 24px; height: 24px; }
    .tab-links li.active a { box-shadow: none; background: transparent; color: var(--accent); }
    .logout-link span { display: none; }
    .content-area { padding: 16px; padding-bottom: 90px; }
    .pay-dock { left: 16px; right: 16px; bottom: 85px; flex-direction: row; padding: 12px 16px; }
    .fc-header-toolbar { flex-direction: column; gap: 10px; }
    .profile-flex { flex-direction: column; text-align: center; }
    .status-dot { right: 50%; transform: translateX(50px); }
    .tags { justify-content: center; }
}


/* --- LOGIN FIXES --- */

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.login-card {
    width: 100%;
    max-width: 400px; /* Обмежуємо ширину */
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.login-header {
    margin-bottom: 30px;
}

.logo-circle {
    width: 60px;
    height: 60px;
    background: var(--accent);
    color: white;
    font-size: 32px;
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 0 20px rgba(240, 90, 40, 0.5);
}

.login-header h2 {
    margin: 0 0 10px;
    font-size: 24px;
}

.login-header p {
    margin: 0;
    color: var(--text-muted);
}

.login-form-content {
    width: 100%;
}

.input-group {
    margin-bottom: 20px;
    text-align: left;
    width: 100%;
}

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

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

.input-icon {
    position: absolute;
    left: 15px;
    width: 20px;
    height: 20px;
    color: var(--text-muted);
}

.input-wrapper input {
    width: 100%;
    padding: 12px 12px 12px 45px; /* Відступ зліва для іконки */
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: white;
    font-size: 16px;
    transition: 0.3s;
    font-family: inherit;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(0, 0, 0, 0.4);
}

.pay-btn.full-width {
    width: 100%;
    margin-top: 10px;
    padding: 15px;
    font-size: 16px;
}

/* Flash Messages */
.flash-messages {
    margin-top: 20px;
    width: 100%;
}

.flash-item {
    background: rgba(220, 38, 38, 0.2);
    border: 1px solid rgba(220, 38, 38, 0.5);
    color: #fecaca;
    padding: 10px;
    border-radius: 10px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}


/* Стиль для спінера */
.spinner {
    position: absolute;
    right: 15px; /* Відступ справа */
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff; /* Колір "активної" частини */
    animation: spin 1s ease-in-out infinite;
    z-index: 10;
}

/* Анімація обертання */
@keyframes spin {
    to { transform: translateY(-50%) rotate(360deg); }
}


.event-details-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.detail-row {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.detail-icon {
    color: var(--accent);
    padding-top: 2px;
}

.detail-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
    word-break: break-word;
}

.text-muted {
    font-style: italic;
    font-size: 14px;
}

/* Layout for Suggestions Tab */
.suggestions-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* Priority Badges Updates */
.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* ID 1: Low (Green) */
.badge-1 { 
    background: rgba(16, 185, 129, 0.2); 
    color: #34d399; 
    border: 1px solid rgba(16, 185, 129, 0.4); 
}

/* ID 2: Medium (Yellow/Gold) */
.badge-2 { 
    background: rgba(251, 191, 36, 0.2); 
    color: #fbbf24; 
    border: 1px solid rgba(251, 191, 36, 0.4); 
}

/* ID 3: High (Orange) */
.badge-3 { 
    background: rgba(249, 115, 22, 0.2); 
    color: #fb923c; 
    border: 1px solid rgba(249, 115, 22, 0.4); 
}

/* ID 4: Critical (Red) */
.badge-4 { 
    background: rgba(239, 68, 68, 0.25); 
    color: #f87171; 
    border: 1px solid rgba(239, 68, 68, 0.5); 
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.2); /* Легке світіння для критичного */
}
/* List Item Styling */
.suggestion-card {
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    position: relative;
    padding-right: 40px; /* Space for arrow */
}
.suggestion-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.08);
}
.suggestion-card::after {
    content: '→';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-weight: bold;
    opacity: 0.5;
}

/* Mobile Adaptation */
@media (max-width: 900px) {
    .suggestions-layout {
        grid-template-columns: 1fr; /* Stack vertically */
    }
}


/* Базові стилі для списку пропозицій */
.suggestion-card {
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}
.suggestion-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.08);
}

/* Кольори бейджів (відповідають PRIORITIES у JS) */
.badge-1 { background: rgba(74, 222, 128, 0.15); color: #4ade80; border: 1px solid rgba(74, 222, 128, 0.3); }
.badge-2 { background: rgba(250, 204, 21, 0.15); color: #facc15; border: 1px solid rgba(250, 204, 21, 0.3); }
.badge-3 { background: rgba(251, 146, 60, 0.15); color: #fb923c; border: 1px solid rgba(251, 146, 60, 0.3); }
.badge-4 { background: rgba(248, 113, 113, 0.15); color: #f87171; border: 1px solid rgba(248, 113, 113, 0.3); box-shadow: 0 0 10px rgba(248, 113, 113, 0.2); }


/* Лоадер на весь екран */
#global-loader {
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    /* Темний фон замість білого, щоб пасував до теми */
    background: rgba(11, 17, 33, 0.85); 
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px); /* Ефект матового скла */
    transition: opacity 0.3s ease, visibility 0.3s;
}

#global-loader.hidden {
    opacity: 0;
    visibility: hidden; /* Важливо: прибирає блокування кліків */
    pointer-events: none;
}

/* Контейнер для спінера */
.spinner {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 1. Трек (кільце-фон) */
.spinner::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.1); /* Тьмяний трек */
    box-sizing: border-box;
}

/* 2. Бігун (активна частина) */
.spinner::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid transparent;
    border-top-color: var(--accent); /* Ваш помаранчевий */
    border-right-color: var(--accent);
    box-sizing: border-box;
    animation: sprint 1s linear infinite;
    /* Додаємо світіння для ефекту енергії */
    box-shadow: 0 0 15px rgba(240, 90, 40, 0.4); 
}

/* 3. Пульс (серцебиття в центрі) */
.spinner-inner {
    width: 40px;
    height: 40px;
    background: var(--accent);
    border-radius: 50%;
    opacity: 0.8;
    animation: heartbeat 1.2s ease-in-out infinite;
    box-shadow: 0 0 20px var(--accent);
}

/* Анімація бігу по колу */
@keyframes sprint {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Анімація пульсу (кардіо) */
@keyframes heartbeat {
    0% { transform: scale(0.85); opacity: 0.5; }
    50% { transform: scale(1); opacity: 1; box-shadow: 0 0 25px var(--accent); }
    100% { transform: scale(0.85); opacity: 0.5; }
}

/* 1. Робимо фон усіх часових слотів червоним (Недоступно) */
.fc .fc-timegrid-slot {
    background-color: rgba(239, 68, 68, 0.15); /* Легкий червоний */
}

/* 2. Важливо: прибираємо стандартну прозорість для подій-підкладок, 
   щоб наш зелений колір повністю перекривав червоний фон */
.fc-bg-event {
    opacity: 1 !important; 
}

/* 3. (Опціонально) Трішки інший відтінок для "Сьогодні", щоб виділялось */
.fc .fc-day-today .fc-timegrid-slot {
    background-color: rgba(239, 68, 68, 0.15); /* Такий самий червоний, або трохи темніший */
}

/* 4. Прибираємо колір ліній сітки, щоб виглядало чистіше (за бажанням) */
.fc-theme-standard td, .fc-theme-standard th {
    border-color: rgba(255, 255, 255, 0.05);
}
