/* 
   Global Pro Developer / iOS Theme
   Overrides generic styling to provide a highly professional, sleek dark mode.
*/

:root {
    /* Base Backgrounds */
    --bg: #0D1117 !important;
    --bg-2: #090B0F !important;
    
    /* Card & Surface Layers */
    --card: #161B22 !important;
    --card-2: #21262D !important;
    
    /* Text */
    --text: #C9D1D9 !important;
    --text-strong: #FFFFFF !important;
    --muted: #8B949E !important;
    
    /* Brand / Accents */
    --accent: #58A6FF !important; /* Professional sleek blue */
    --accent-2: #8957E5 !important; /* Subtle purple */
    --success: #3FB950 !important;
    --danger: #F85149 !important;
    
    /* Components */
    --chip: #21262D !important;
    --border: rgba(240, 246, 252, 0.1) !important;
    --border-highlight: rgba(240, 246, 252, 0.2) !important;
    
    /* Shadows & Radii */
    --ring: 0 0 0 2px rgba(88, 166, 255, 0.3), 0 8px 18px rgba(0, 0, 0, 0.6) !important;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
    --radius: 14px !important;
    --radius-lg: 20px !important;
}

/* Global Reset Overrides */
html, body {
    background-color: var(--bg) !important;
    background-image: none !important; /* Strip cheesy SVG background */
    color: var(--text) !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji" !important;
    -webkit-font-smoothing: antialiased;
}

/* Modern iOS / Pro Glass Topbar */
.topbar {
    background: rgba(13, 17, 23, 0.75) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border-bottom: 1px solid var(--border) !important;
    box-shadow: none !important;
}

/* Cards & Surfaces */
.tile, .section-content, .card {
    background: var(--card) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow) !important;
    transition: all 0.2s ease !important;
}

.tile:active, .card:active {
    transform: scale(0.97) !important;
    border-color: var(--border-highlight) !important;
}

/* Typography refinements */
h1, h2, h3, h4, .brand-name {
    color: var(--text-strong) !important;
    font-weight: 600 !important;
    letter-spacing: -0.02em !important;
}

p, span, .label {
    color: var(--text) !important;
}

/* Bottom Tab Bar (iOS style) */
.bottom-tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(60px + env(safe-area-inset-bottom));
    background: rgba(13, 17, 23, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 1000;
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    color: var(--muted);
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    gap: 4px;
    height: 100%;
}

.tab-item.active {
    color: var(--accent);
}

.tab-item svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2;
}

.tab-item.active svg {
    fill: rgba(88, 166, 255, 0.2);
}

/* Page padding to account for tab bar */
body {
    padding-bottom: 0 !important;
}

.app {
    padding-bottom: calc(80px + env(safe-area-inset-bottom)) !important;
}

.content, .chat-container, main {
    padding-bottom: calc(80px + env(safe-area-inset-bottom)) !important;
}

/* Hide old sidebar and menu elements */
.menu-btn, .sidebar, #menu-overlay {
    display: none !important;
}

/* Redesign Gradient Banners to be Professional */
.gradient-banner {
    background: var(--card-2) !important;
    border: 1px solid var(--border) !important;
    box-shadow: none !important;
    transition: all 0.2s ease !important;
}
.gradient-banner:hover {
    border-color: var(--accent) !important;
    background: rgba(88, 166, 255, 0.05) !important;
}
.gradient-banner span {
    color: var(--text-strong) !important;
    text-shadow: none !important;
}

/* Fix PYQ Filter Buttons & Inner Page Colors */
.filter-btn {
    background: var(--card-2) !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
    border-radius: 10px !important;
    box-shadow: none !important;
}
.filter-btn .paper-sn, .filter-btn .subject-name {
    color: var(--text) !important;
}
.filter-btn .paper-count {
    background: rgba(88, 166, 255, 0.15) !important;
    color: var(--accent) !important;
    border: 1px solid rgba(88, 166, 255, 0.3) !important;
}
.filter-btn:active {
    background: var(--card) !important;
    border-color: var(--accent) !important;
}

/* Fix specific inline gradients that cause mismatches */
[style*="background: linear-gradient(135deg, #00eeff, #0055ff)"],
[style*="background: linear-gradient(135deg, #ff007f, #7a00ff)"],
[style*="background: linear-gradient(135deg, #00eeff"] {
    background: var(--card-2) !important;
    border: 1px solid var(--accent) !important;
    box-shadow: none !important;
}

/* Fix links and unreadable text */
a, [style*="color: rgb("], [style*="color: #"] {
    color: var(--text) !important;
}
a:hover {
    color: var(--accent) !important;
}
[style*="color: var(--accent-2)"] {
    color: var(--muted) !important;
}

/* Universal Back Button for inner pages */
.global-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text);
    margin-right: 12px;
    text-decoration: none;
    transition: all 0.2s;
}
.global-back-btn:active {
    background: rgba(255, 255, 255, 0.1);
}
.global-back-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
}


@keyframes rgbText { 0% { color: #ff0000; } 33% { color: #00ff00; } 66% { color: #0000ff; } 100% { color: #ff0000; } }

