


@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800&display=swap');

:root {
    /* LIGHT THEME */
    --bg-gradient-start: #f3f4f6;
    --bg-gradient-end: #e5e7eb;
    --panel-bg: rgba(255, 255, 255, 0.9);
    --text-color: #1f2937;
    --text-muted: #6b7280;
    --input-bg: #ffffff;
    --input-border: #d1d5db;
    --card-bg: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.08);
    --nav-bg: rgba(255, 255, 255, 0.8);
    --menu-item-bg: #ffffff;
    --accent-color: #667eea;
}

[data-theme="dark"] {
    /* DARK THEME */
    --bg-gradient-start: #111827;
    --bg-gradient-end: #000000;
    --panel-bg: rgba(30, 30, 30, 0.95);
    --text-color: #f3f4f6;
    --text-muted: #9ca3af;
    --input-bg: #1f2937;
    --input-border: #374151;
    --card-bg: #1f2937;
    --shadow-color: rgba(0, 0, 0, 0.4);
    --nav-bg: rgba(17, 24, 39, 0.8);
    --menu-item-bg: #1f2937;
    --accent-color: #818cf8;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    color: var(--text-color);
    transition: background 0.3s, color 0.3s;
    overflow-x: hidden; 
}

/* --- THEMATIC LOADER --- */
.global-loader {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #667eea; /* Fallback */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 9999;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    transition: opacity 0.5s ease-out, visibility 0.5s;
}

.global-loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-brand { font-size: 3.5rem; font-weight: 900; color: white; letter-spacing: -2px; margin-bottom: 20px; text-shadow: 0 10px 30px rgba(0,0,0,0.2); animation: float 3s ease-in-out infinite; }
.loader-spinner-circle { width: 50px; height: 50px; border: 4px solid rgba(255,255,255,0.2); border-top: 4px solid #fff; border-radius: 50%; animation: spin 1s linear infinite; }

@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* --- SKELETON LOADING --- */
.skeleton {
    background: linear-gradient(90deg, rgba(128,128,128,0.1) 25%, rgba(128,128,128,0.2) 50%, rgba(128,128,128,0.1) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
    color: transparent !important;
    pointer-events: none;
}
.skeleton-rect { width: 100%; height: 60px; border-radius: 12px; margin-bottom: 10px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* --- ANIMATIONS --- */
.stagger-in { opacity: 0; animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
@keyframes slideInRight { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

.view-section { animation: fadeScaleIn 0.3s ease-out forwards; }
@keyframes fadeScaleIn { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: scale(1); } }

/* --- BREADCRUMB / COLLAPSIBLE NAV --- */
.breadcrumb-nav {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding: 8px 0;
    margin-bottom: 10px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.breadcrumb-nav::-webkit-scrollbar { display: none; }

.crumb-item {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    cursor: pointer;
    display: flex;
    align-items: center;
    background: var(--input-bg);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid var(--input-border);
    transition: all 0.2s;
}
.crumb-item:hover { color: var(--accent-color); border-color: var(--accent-color); }
.crumb-item.active { background: var(--accent-color); color: white; border-color: var(--accent-color); }
.crumb-separator { font-size: 0.7rem; color: var(--text-muted); opacity: 0.5; }

/* --- NOTIFICATIONS --- */
.telegram-notification {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(50px);
    background: rgba(40, 40, 40, 0.95); color: white;
    padding: 12px 24px; border-radius: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3); z-index: 2000;
    opacity: 0; pointer-events: none; transition: all 0.4s; font-weight: 600;
}
.telegram-notification.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --- BACK TO TOP --- */
.back-to-top-btn {
    position: fixed; bottom: 90px; right: 20px; width: 50px; height: 50px;
    background: var(--panel-bg); backdrop-filter: blur(10px); color: var(--text-color);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    z-index: 1400; opacity: 0; transform: scale(0.5); pointer-events: none;
    transition: all 0.3s; border: 1px solid var(--input-border);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2); cursor: pointer;
}
.back-to-top-btn.visible { opacity: 1; pointer-events: auto; transform: scale(1); }

/* --- MODALS --- */
.top-sheet { animation: slideDown 0.4s forwards; margin-top: 80px; border-radius: 20px; align-self: flex-start !important; max-height: 85vh; overflow-y: auto; }
@keyframes slideDown { from { transform: translateY(-100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.loading-spinner {
    display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 60px; height: 60px; border: 5px solid rgba(255, 255, 255, 0.3);
    border-top: 5px solid var(--accent-color); border-radius: 50%; animation: spin 1s linear infinite; z-index: 9999;
}
