:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --accent: #0ea5e9;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --glass: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.4);
    --text-main: #1e1b4b;
    --text-muted: #64748b;
    --shadow: 0 20px 50px rgba(0,0,0,0.08);
    /* BPS Brand Colors */
    --bps-blue: #00a0e9;
    --bps-orange: #f39200;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    color: var(--text-main);
    background: #f8fafc;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    padding-top: 20px;
}

h1, h2, h3, h4, h5, .phd-font-heading {
    font-family: 'Outfit', sans-serif;
}

/* Background Animated Blobs */
.bg-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15), transparent 70%);
    filter: blur(80px);
    animation: float 25s infinite alternate;
}

.blob-1 { top: -10%; left: -10%; background: radial-gradient(circle, rgba(99, 102, 241, 0.15), transparent 70%); }
.blob-2 { top: 40%; right: -10%; background: radial-gradient(circle, rgba(139, 92, 246, 0.12), transparent 70%); animation-delay: -5s; }
.blob-3 { bottom: -10%; left: 20%; background: radial-gradient(circle, rgba(14, 165, 233, 0.1), transparent 70%); animation-delay: -10s; }

@keyframes float {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(50px, 50px) scale(1.1); }
}

/* Glass Card */
.glass-card {
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 30px;
    margin-bottom: 30px;
    transition: transform 0.3s ease;
}

/* Modern Tables */
.phd-table-container {
    overflow-x: auto;
    border-radius: 20px;
    border: 1px solid rgba(0,0,0,0.05);
    background: white;
}

table.phd-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

table.phd-table th {
    background: #f8fafc;
    padding: 16px;
    text-align: left;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    border-bottom: 2px solid #f1f5f9;
}

table.phd-table td {
    padding: 16px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s ease;
}

table.phd-table tr:last-child td {
    border-bottom: none;
}

table.phd-table tr:hover td {
    background: rgba(99, 102, 241, 0.02);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 12px;
    border: none;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.btn-primary { background: var(--primary); color: white; box-shadow: 0 10px 20px rgba(99, 102, 241, 0.2); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 15px 30px rgba(99, 102, 241, 0.3); }

.btn-success { background: #dcfce7; color: #15803d; }
.btn-success:hover { background: #bbf7d0; transform: translateY(-2px); }

.btn-danger { background: #fee2e2; color: #b91c1c; }
.btn-danger:hover { background: #fecaca; transform: translateY(-2px); }

.btn-ghost { background: #f1f5f9; color: var(--text-muted); }
.btn-ghost:hover { background: #e2e8f0; color: var(--text-main); }

/* Badges */
.badge {
    display: inline-flex;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-green { background: #dcfce7; color: #166534; }
.badge-rose { background: #ffe4e6; color: #9f1239; }
.badge-amber { background: #fef3c7; color: #92400e; }
.badge-gray { background: #f1f5f9; color: #475569; }

/* Form Controls */
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #f1f5f9;
    background: #f8fafc;
    border-radius: 14px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.form-input:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* Modals */
.phd-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 110000;
    padding: 20px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.phd-modal[style*="display: flex"] {
    opacity: 1;
    pointer-events: auto;
}

.phd-modal-content {
    background: white;
    width: 100%;
    max-width: 500px;
    border-radius: 32px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    position: relative;
    z-index: 110001; /* Above modal overlay */
    margin-top: 100px; /* Clear floating navbar */
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    body { padding: 15px; }
    .glass-card { padding: 20px; }
    .phd-modal-content { padding: 25px; }
}

/* Custom Scrollbar for Analytics */
.custom-scroll::-webkit-scrollbar { width: 5px; }
.custom-scroll::-webkit-scrollbar-track { background: transparent; }
.custom-scroll::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 10px; }
.custom-scroll::-webkit-scrollbar-thumb:hover { background: var(--primary-light); }

/* Global Footer */
/* Global Footer - Premium Aesthetic */
.phd-footer {
    padding: 80px 20px 60px;
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 10;
    width: 100%;
    box-sizing: border-box;
}

.footer-glass {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 48px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 30px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.03);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0 auto;
}

.footer-glass:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.7);
    border-color: var(--primary);
    box-shadow: 0 25px 50px rgba(99, 102, 241, 0.12);
}

.footer-divider {
    width: 40px;
    height: 4px;
    background: var(--primary);
    border-radius: 10px;
    opacity: 0.2;
    margin-bottom: 5px;
}

.footer-text {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.3px;
}

.footer-link {
    font-family: 'Outfit', sans-serif;
    color: var(--primary);
    text-decoration: none;
    font-weight: 800;
    font-size: 16px;
    letter-spacing: 0.5px;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}


.footer-link:hover {
    color: var(--secondary);
    letter-spacing: 1px;
}

/* Region & Insight styles */
.region-label {
    font-family: 'Outfit', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    background: rgba(0, 160, 233, 0.1);
    padding: 6px 16px;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid rgba(0, 160, 233, 0.1);
}

.insight-panel {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(241, 245, 249, 0.9) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 30px;
    padding: 25px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.03);
    margin-bottom: 30px;
    animation: slideDown 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0) }
}

.insight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.insight-card {
    background: white;
    padding: 20px;
    border-radius: 20px;
    border: 1px solid #f1f5f9;
    transition: all 0.3s ease;
}

.insight-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

.insight-val {
    font-family: 'Outfit';
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 5px;
}

.insight-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
}

/* Shimmer Loading Animation */
.shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 10px;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Selection Toolbox & Modern Glassmorphism */
.selection-toolbox {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 35px;
    border-radius: 35px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    margin-bottom: 40px;
}

/* Subject Progressively Loading List */
.subject-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 25px 0;
    max-height: 400px;
    overflow-y: auto;
    padding: 5px;
}

/* Modern Pill Tags */
.subject-tag {
    padding: 10px 18px;
    border-radius: 50px; /* Pill shape */
    background: rgba(0, 160, 233, 0.05); /* Very soft blue */
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 13px;
    font-weight: 700;
    display: inline-block;
    text-decoration: none;
    color: #475569;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.subject-tag:hover {
    transform: scale(1.08) translateY(-3px);
    background: white;
    color: var(--bps-blue);
    box-shadow: 0 15px 30px rgba(0, 160, 233, 0.15);
    border-color: rgba(0, 160, 233, 0.1);
}

.subject-tag.active {
    background: linear-gradient(135deg, var(--bps-blue) 0%, #00d2ff 100%);
    color: white;
    box-shadow: 0 10px 20px rgba(0, 160, 233, 0.3);
    border: none;
    transform: scale(1.05);
}

/* Custom Search Input Refinement */
#subjectSearch {
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
}

#subjectSearch:focus {
    border-color: var(--bps-blue);
    box-shadow: 0 0 0 4px rgba(0, 160, 233, 0.1);
    transform: translateY(-2px);
}

/* BPS Tab Navigation */
.bps-tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.5);
    padding: 10px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    width: fit-content;
}

.bps-tab-btn {
    padding: 12px 25px;
    border-radius: 15px;
    font-weight: 800;
    font-size: 14px;
    color: var(--text-muted);
    transition: all 0.3s ease;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: 'Outfit';
}

.bps-tab-btn:hover {
    background: rgba(0, 160, 233, 0.05);
    color: var(--bps-blue);
}

.bps-tab-btn.active {
    background: var(--bps-blue);
    color: white;
    box-shadow: 0 10px 20px rgba(0, 160, 233, 0.2);
}

/* Specific pill for Education */
.edu-special {
    background: rgba(99, 102, 241, 0.1) !important;
    color: var(--primary) !important;
    border: 1px solid rgba(99, 102, 241, 0.2) !important;
}

.edu-special.active {
    background: var(--primary) !important;
    color: white !important;
}
