* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --success: #0caf60;
    --warning: #ffa116;
    --danger: #ef4444;
    --bg-dark: #0f1419;
    --bg-card: #1a1f2e;
    --bg-hover: #252d3d;
    --text-primary: #e8eaed;
    --text-secondary: #9aa0a6;
    --border: #2d3748;
    --easy: #00b8a3;
    --medium: #ffc01e;
    --hard: #ff375f;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--primary), var(--success));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stats {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.stat-card {
    background: var(--bg-card);
    padding: 20px 40px;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.controls {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.search-box {
    margin-bottom: 15px;
}

.search-box input {
    width: 100%;
    padding: 12px 20px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
}

.filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filters select, .filters button {
    padding: 10px 15px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.95rem;
}

.filters select:focus {
    outline: none;
    border-color: var(--primary);
}

#resetBtn {
    background: var(--primary);
    border: none;
    color: white;
    font-weight: 500;
    transition: background 0.2s;
}

#resetBtn:hover {
    background: var(--primary-dark);
}

.content {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 20px;
}

.topics-sidebar {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.topic-item {
    padding: 10px 15px;
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topic-item:hover {
    background: var(--bg-hover);
}

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

.topic-count {
    background: var(--bg-dark);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
}

.questions-container {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.topic-section {
    margin-bottom: 30px;
}

.topic-header {
    font-size: 1.5rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topic-progress {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.question-card {
    background: var(--bg-dark);
    padding: 15px;
    margin-bottom: 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.question-card:hover {
    border-color: var(--primary);
    transform: translateX(5px);
}

.question-card.solved {
    border-left: 4px solid var(--success);
}

.question-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
}

.checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--success);
}

.question-number {
    font-weight: bold;
    color: var(--text-secondary);
    min-width: 30px;
}

.question-title {
    flex: 1;
    font-size: 1.1rem;
    font-weight: 500;
}

.difficulty {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.difficulty.Easy {
    background: rgba(0, 184, 163, 0.1);
    color: var(--easy);
}

.difficulty.Medium {
    background: rgba(255, 192, 30, 0.1);
    color: var(--medium);
}

.difficulty.Hard {
    background: rgba(255, 55, 95, 0.1);
    color: var(--hard);
}

.question-details {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    padding-left: 35px;
}

.detail-tag {
    background: var(--bg-hover);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.question-actions {
    display: flex;
    gap: 10px;
    padding-left: 35px;
}

.btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card);
}

.btn-revision {
    background: var(--warning);
    color: white;
}

.btn-revision:hover {
    background: #e89000;
}

.btn-revision.active {
    background: var(--success);
}

.note-preview {
    padding: 10px;
    margin-top: 10px;
    margin-left: 35px;
    background: var(--bg-hover);
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-left: 3px solid var(--primary);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
}

.modal-content {
    background: var(--bg-card);
    margin: 10% auto;
    padding: 30px;
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
}

.close {
    color: var(--text-secondary);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: var(--text-primary);
}

.modal-content h2 {
    margin-bottom: 20px;
}

#noteText {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
}

#noteText:focus {
    outline: none;
    border-color: var(--primary);
}

#saveNote {
    margin-top: 15px;
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
}

#saveNote:hover {
    background: var(--primary-dark);
}

@media (max-width: 768px) {
    .content {
        grid-template-columns: 1fr;
    }
    
    .topics-sidebar {
        position: static;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .filters {
        flex-direction: column;
    }
    
    .filters select, .filters button {
        width: 100%;
    }
}


.clickable {
    cursor: pointer;
    transition: transform 0.2s;
}

.clickable:hover {
    transform: scale(1.05);
}

.btn-special {
    background: linear-gradient(135deg, var(--primary), var(--success));
    color: white;
    font-weight: 600;
}

.btn-special:hover {
    opacity: 0.9;
}

#interviewQuestion {
    background: var(--bg-dark);
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

#timerDisplay {
    text-align: center;
    font-weight: bold;
}

.time-spent {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 5px;
}

.insight-card {
    background: var(--bg-dark);
    padding: 15px;
    margin: 10px 0;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-dark);
    border-radius: 4px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    transition: width 0.3s;
}


.solved-date {
    background: rgba(12, 175, 96, 0.1) !important;
    color: var(--success) !important;
    font-weight: 500;
}

.question-card.solved .solved-date {
    animation: fadeIn 0.3s ease-in;
}

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