/* public/style.css — Исправлено: гарантированная видимость контента */
:root {
    --bg: #f8fafc;
    --card: #fff;
    --primary: #2563eb;
    --text: #0f172a;
    --border: #e2e8f0;
    --error: #dc2626;
    --success: #059669;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: system-ui, -apple-system, sans-serif; }

body {
    background: var(--bg);
    color: var(--text);
    padding: 1rem;
    min-height: 100vh;
    opacity: 1 !important; /* ✅ Гарантируем видимость */
}

/* ✅ КРИТИЧНО: класс для скрытия элементов */
.hidden { display: none !important; visibility: hidden !important; }

main {
    max-width: 1000px;
    margin: 2rem auto;
    text-align: center;
    opacity: 1; /* ✅ Явно показываем контент */
}

/* Лоадер */
#loader {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: opacity 0.3s ease;
}
#loader.hidden {
    opacity: 0;
    pointer-events: none;
}
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Карточки и формы */
.card {
    background: var(--card);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 1rem;
    text-align: left;
}
form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 320px;
    margin: 1rem auto;
}
input, button {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
}
button, .btn {
    background: var(--primary);
    color: #fff;
    border: none;
    cursor: pointer;
    font-weight: 500;
}
button:hover { opacity: 0.9; }
.btn-google { background: #4285F4; margin-top: 0.5rem; }

/* Вкладки */
.tabs { display: flex; gap: 0.5rem; justify-content: center; margin: 1rem 0; }
.tab { background: transparent; color: var(--primary); }
.tab.active { background: var(--primary); color: #fff; }

/* Списки */
.placeholder { color: #64748b; font-style: italic; padding: 0.5rem; }
.error { color: var(--error); font-weight: 500; }

/* Дашборд */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--card);
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.stat-item {
    text-align: center;
    padding: 0.75rem;
    background: #f1f5f9;
    border-radius: 8px;
}
.stat-item strong {
    font-size: 1.4rem;
    color: var(--primary);
    display: block;
}

/* Загрузка файлов */
.upload-box {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
}
.status-msg { font-size: 0.9rem; }
.preview-container img {
    max-width: 200px;
    border-radius: 8px;
    margin-top: 0.5rem;
}
.file-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Адаптив */
@media (max-width: 600px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    nav { flex-direction: column; gap: 0.5rem; }
}

/* === FIX: Принудительное управление видимостью === */
#loader.hidden {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}
main, .auth-form, .dashboard-grid, .card, nav {
    opacity: 1 !important;
    display: block !important;
    visibility: visible !important;
}
.hidden { display: none !important; }