:root {
    /* Color Palette */
    --primary-color: #4e5bf2; /* Deep Blue/Purple from image */
    --secondary-color: #fe9568; /* Orange from image */
    --bg-color: #f5f6fa; /* Light grey background */
    --card-bg: #ffffff;
    --text-primary: #2d3436;
    --text-secondary: #636e72;
    --border-color: #dfe6e9;
    
    /* Layout */
    --sidebar-width: 260px;
    --header-height: 80px;
    
    /* Radius */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 8px 24px rgba(78, 91, 242, 0.08);
    --shadow-hover: 0 12px 32px rgba(78, 91, 242, 0.15);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.app-sidebar {
    width: var(--sidebar-width);
    background: var(--card-bg);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    padding: 30px 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0,0,0,0.02);
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 50px;
    padding-left: 10px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    border-radius: 8px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-item:hover {
    background: #f0f2ff;
    color: var(--primary-color);
}

.nav-item.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(78, 91, 242, 0.3);
}

.nav-icon {
    margin-right: 12px;
    font-size: 18px;
}

/* Main Content */
.app-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 40px;
    max-width: 1400px;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.search-box {
    background: white;
    padding: 12px 20px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    width: 400px;
    box-shadow: var(--shadow-sm);
    border: 1px solid transparent;
    transition: all 0.3s;
}

.search-box:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(78, 91, 242, 0.1);
}

.search-input {
    border: none;
    outline: none;
    width: 100%;
    margin-left: 10px;
    font-size: 14px;
    color: var(--text-primary);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #e0e0e0;
    overflow: hidden;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
}

/* Filter Tags */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.filter-tag {
    padding: 8px 20px;
    background: white;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    text-decoration: none;
}

.filter-tag:hover {
    color: var(--primary-color);
    background: #f0f2ff;
}

.filter-tag.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 10px rgba(78, 91, 242, 0.2);
}

/* Exam Grid */
.exam-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.exam-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 24px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: flex;
    flex-direction: column;
}

.exam-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: #f0f0f0;
}

.card-icon-bg {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: #f0f2ff;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 16px;
}

/* Different colors for subjects */
.subj-c .card-icon-bg { background: #e3f2fd; color: #2196f3; }
.subj-python .card-icon-bg { background: #fff3e0; color: #ff9800; }
.subj-scratch .card-icon-bg { background: #fce4ec; color: #e91e63; }
.subj-robot .card-icon-bg { background: #e8f5e9; color: #4caf50; }

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.4;
}

.card-meta {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding-top: 15px;
}

.card-btn {
    margin-left: auto;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 13px;
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px;
    background: white;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
}

/* Exam Page Specific */
.exam-container {
    display: flex;
    gap: 30px;
}

.question-area {
    flex: 1;
    background: white;
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-sm);
    min-height: 600px;
}

.sidebar-right {
    width: 300px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.timer-box {
    text-align: center;
}
.timer-val {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary-color);
}

.q-nav-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.q-nav-item {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #f5f6fa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
}

.q-nav-item.active {
    background: var(--primary-color);
    color: white;
}

.q-nav-item.done {
    background: #e3f2fd;
    color: var(--primary-color);
}

/* Question Styles */
.q-tag {
    background: #eef2ff;
    color: var(--primary-color);
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
    display: inline-block;
    margin-bottom: 15px;
}

.q-content {
    font-size: 18px;
    line-height: 1.6;
    color: #2d3436;
    margin-bottom: 30px;
}

.option-item {
    border: 2px solid #f1f2f6;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 12px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.option-item:hover {
    border-color: #d1d8e0;
    background: #f8f9fa;
}

.option-item.selected {
    border-color: var(--primary-color);
    background: #eef2ff;
}

.opt-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #dfe6e9;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.selected .opt-circle {
    border-color: var(--primary-color);
    background: var(--primary-color);
}

.selected .opt-circle::after {
    content: '';
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}
