:root {
    --bg-dark: #0f111a;
    --bg-panel: rgba(25, 28, 41, 0.6);
    --border-glass: rgba(255, 255, 255, 0.08);
    
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    
    --accent-easy: #00b8a3;
    --accent-medium: #ffc01e;
    --accent-hard: #ff375f;
    --accent-primary: #3b82f6;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(0, 184, 163, 0.05) 0%, transparent 25%);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 2rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Glassmorphism Panels */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, border-color 0.2s ease;
}
.glass-panel:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

/* Header */
.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.profile-info h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    background: linear-gradient(90deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.profile-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Stats Row */
.quick-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.stat-box {
    display: flex;
    flex-direction: column;
    padding: 0.75rem 1.25rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    border: 1px solid var(--border-glass);
    min-width: 100px;
}
.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}
.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
}

.stat-box.easy .stat-value { color: var(--accent-easy); }
.stat-box.medium .stat-value { color: var(--accent-medium); }
.stat-box.hard .stat-value { color: var(--accent-hard); }

/* Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
}

.activity-panel { grid-column: span 12; }
.badges-panel { grid-column: span 12; }
.languages-panel { grid-column: span 4; }
.topics-panel { grid-column: span 4; }
.curriculum-panel { grid-column: span 4; }

@media (max-width: 1024px) {
    .languages-panel, .topics-panel, .curriculum-panel { grid-column: span 6; }
}
@media (max-width: 768px) {
    .dashboard-grid > section { grid-column: span 12 !important; }
}

h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #fff;
}

/* Charts */
.chart-container {
    position: relative;
    height: 250px;
    width: 100%;
}
.pie-container, .radar-container {
    height: 330px;
}

/* Curriculum Progress */
.curriculum-item {
    margin-bottom: 1.25rem;
}
.curriculum-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}
.progress-bar-bg {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), #60a5fa);
    border-radius: 4px;
    transition: width 1s ease-out;
}

footer {
    text-align: center;
    margin-top: 3rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}
/* Table Panel */
.table-panel { grid-column: span 12; margin-top: 1rem; }

.table-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

#problemSearch {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-family: inherit;
    width: 250px;
}
#problemSearch:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.tag-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.tag-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-muted);
}
.tag-badge:hover {
    background: rgba(255, 255, 255, 0.1);
}
.tag-badge.active {
    background: rgba(59, 130, 246, 0.2);
    border-color: var(--accent-primary);
    color: #fff;
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-glass);
}
th {
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

td a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
}
td a:hover {
    color: var(--accent-primary);
    text-decoration: underline;
}

.diff-easy { color: var(--accent-easy); }
.diff-medium { color: var(--accent-medium); }
.diff-hard { color: var(--accent-hard); }

.tag-list {
    color: var(--text-muted);
    font-size: 0.75rem;
}
/* Curriculum Badges */
.curr-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.cb-blind75 { background: rgba(255, 192, 30, 0.15); color: #ffc01e; border-color: rgba(255, 192, 30, 0.3); }
.cb-neetcode150 { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border-color: rgba(59, 130, 246, 0.3); }
.cb-leetcode75 { background: rgba(16, 185, 129, 0.15); color: #34d399; border-color: rgba(16, 185, 129, 0.3); }
.cb-top150 { background: rgba(239, 68, 68, 0.15); color: #f87171; border-color: rgba(239, 68, 68, 0.3); }

.header-left {
    flex: 1;
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.rank-chart-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.rank-chart-container {
    width: 450px;
    height: 60px;
}

.rank-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    width: 100%;
}

.timeframe-filters button {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s;
}

.timeframe-filters button:hover, .timeframe-filters button.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.rank-chart-labels {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-size: 0.75rem;
    color: #94a3b8;
    font-family: 'Inter', sans-serif;
    margin-top: 4px;
}

/* Badges Grid */
.badges-panel {
    margin-bottom: 2rem;
}

.badges-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-start;
    margin-top: 1.5rem;
}

.badge-item {
    width: 65px;
    height: 65px;
    background: rgba(255, 255, 255, 0.03);
    perspective: 1000px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.badge-item:not(.empty):hover {
    transform: translateY(-5px) scale(1.05);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2), 0 0 15px rgba(255, 161, 22, 0.2);
    border-color: rgba(255, 161, 22, 0.3);
}

.badge-item.empty {
    opacity: 0.3;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    background: transparent;
    cursor: default;
}

.badge-item img {
    animation: badge-sway 4s ease-in-out infinite alternate;
    transform-style: preserve-3d;
    max-width: 85%;
    max-height: 85%;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
    transition: filter 0.3s ease;
}

.badge-item:hover img {
    filter: drop-shadow(0 6px 12px rgba(255, 161, 22, 0.4));
}

.badge-tooltip {
    position: absolute;
    bottom: -45px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.badge-tooltip strong {
    color: var(--accent);
    display: block;
    margin-bottom: 2px;
}

.badge-tooltip small {
    color: var(--text-muted);
}

.badge-item:hover .badge-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Responsive adjustments for badges grid */
@media (max-width: 1200px) {
    .badges-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        justify-content: flex-start;
        margin-top: 1.5rem;
    }
}

@media (max-width: 768px) {
    .badges-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        justify-content: flex-start;
        margin-top: 1.5rem;
    }
}

@media (max-width: 480px) {
    .badges-grid {
        display: flex;
    }
}

.badge-item:hover img {
    animation: badge-spin 1.5s linear infinite;
    transform-style: preserve-3d;
}

@keyframes badge-spin {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

@keyframes badge-sway {
    0% { transform: rotateY(-35deg) rotateX(15deg); }
    100% { transform: rotateY(35deg) rotateX(-15deg); }
}

/* Scale up the radar chart to fill more space */
#topicChart {
    transform: scale(1.2);
}

/* Header Badges adjustments */
.header-badges {
    margin-top: 1rem;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 8px;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.header-badges::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

.header-badges .badge-item {
    width: 45px;
    height: 45px;
    padding: 4px;
    border-radius: 8px;
    background: transparent;
    border: none;
}

.header-badges .badge-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateY(-3px) scale(1.1);
}

.profile-info {
    margin-bottom: 0.5rem;
}

/* Push the global rank block down to align with subtitle */
.header-right {
    margin-top: 34px;
}

/* Portfolio Additions */
.portfolio-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}
.portfolio-btn.primary:hover {
    background: #2563eb !important; /* darker blue */
}
.exp-card, .proj-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.exp-card:hover, .proj-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}
.proj-card:hover {
    border-color: #3b82f6 !important;
}
