/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --success-color: #059669;
    --success-bg: #d1fae5;
    --warning-color: #d97706;
    --warning-bg: #fef3c7;
    --danger-color: #dc2626;
    --danger-bg: #fee2e2;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --primary-color-rgb: 79, 70, 229;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header styles */
header {
    margin-bottom: 2rem;
}

h1 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 2.5rem;
    font-weight: 800;
    animation: slideIn 0.6s ease-out;
    background: linear-gradient(120deg, var(--primary-color), var(--primary-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Progress summary styles */
.progress-summary {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin-bottom: 2rem;
}

.overall-progress {
    margin-bottom: 1.5rem;
}

.overall-progress h3 {
    color: var(--text-primary);
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    animation: progressFill 1s ease-out;
    background-size: 200% 100%;
    animation: progressFill 1s ease-out, gradientMove 2s linear infinite;
}

.topic-progress {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.topic-card {
    background: var(--bg-color);
    padding: 1.25rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: scaleIn 0.5s ease-out;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.topic-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.topic-card:hover::before,
.topic-card.active::before {
    transform: scaleX(1);
}

.topic-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px -8px rgba(var(--primary-color-rgb), 0.2);
}

.topic-card.active {
    background: rgba(var(--primary-color-rgb), 0.05);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -6px rgba(var(--primary-color-rgb), 0.2);
}

.topic-card h4 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    transition: color 0.2s ease;
}

.topic-card.active h4 {
    color: var(--primary-color);
}

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

/* Add a subtle ripple effect */
.topic-card::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(var(--primary-color-rgb), 0.1) 0%, transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: transform 0.5s ease, opacity 0.5s ease;
    pointer-events: none;
}

.topic-card:active::after {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    transition: transform 0s, opacity 0.2s;
}

/* Controls section styles */
.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

select {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    min-width: 150px;
    font-size: 0.95rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

select:hover {
    border-color: var(--primary-color);
}

select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.btn {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.5s;
}

.btn:active::after {
    transform: translate(-50%, -50%) scale(1);
    transition: transform 0s;
}

.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--text-secondary);
}

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

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

.btn-danger:hover {
    background: #b91c1c;
}

.button-group {
    display: flex;
    gap: 1rem;
}

/* Questions list styles */
.questions-list {
    display: grid;
    gap: 1rem;
}

.question-card {
    background: var(--card-bg);
    padding: 1.25rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
    animation: slideIn 0.5s ease-out backwards;
}

.question-card[data-status="Completed"] {
    background: var(--success-bg);
    border-color: var(--success-color);
}

.question-card[data-status="In Progress"] {
    background: var(--warning-bg);
    border-color: var(--warning-color);
}

.question-info {
    flex: 1;
}

.question-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
}

.question-link {
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    transition: all 0.2s ease;
}

.question-link:hover {
    color: var(--primary-hover);
    transform: translateY(-1px);
}

.question-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    align-items: center;
    flex-wrap: wrap;
}

.difficulty {
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.difficulty::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    100% { transform: translateX(100%); }
}

.difficulty.Easy { 
    background: var(--success-bg); 
    color: var(--success-color);
}

.difficulty.Medium { 
    background: var(--warning-bg); 
    color: var(--warning-color);
}

.difficulty.Hard { 
    background: var(--danger-bg); 
    color: var(--danger-color);
}

.status-select {
    min-width: 140px;
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
    cursor: pointer;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

.modal.active .modal-content {
    animation: scaleIn 0.3s ease-out;
}

.modal-content {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-content h2 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    transform: translateY(-1px);
}

.form-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* Notes modal specific styles */
.notes-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.notes-header h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

#notes-last-modified {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: vertical;
    transition: all 0.2s ease;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

#question-solution {
    background: #f8fafc;
}

.complexity-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Notes indicator in question card */
.notes-indicator {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    background: var(--primary-color);
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-left: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.notes-indicator:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.notes-indicator svg {
    width: 14px;
    height: 14px;
    margin-right: 0.25rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filters {
        flex-direction: column;
    }
    
    .question-card {
        flex-direction: column;
        align-items: stretch;
    }
    
    .question-meta {
        flex-wrap: wrap;
    }
    
    .button-group {
        width: 100%;
    }
    
    .button-group .btn {
        flex: 1;
    }
    
    .complexity-group {
        grid-template-columns: 1fr;
    }
} 

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes progressFill {
    from {
        width: 0;
    }
}

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

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(var(--primary-color-rgb), 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(var(--primary-color-rgb), 0); }
    100% { box-shadow: 0 0 0 0 rgba(var(--primary-color-rgb), 0); }
}

.question-card.new {
    animation: pulse 2s infinite;
}

.status-select.loading {
    position: relative;
    pointer-events: none;
}

.status-select.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border: 2px solid var(--primary-color);
    border-top-color: transparent;
    border-radius: 50%;
    animation: rotate 0.8s linear infinite;
}

@keyframes rotate {
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* Toast Notification */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.toast {
    background-color: #4CAF50;
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    margin: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.error {
    background-color: #f44336;
}

.toast .icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast .icon svg {
    width: 20px;
    height: 20px;
}

.toast .message {
    flex: 1;
}

/* Analytics Modal Styles */
.analytics-content {
    max-width: 1000px !important;
    width: 95% !important;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem !important;
}

.analytics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    transition: color 0.2s ease;
}

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

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.analytics-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.analytics-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 12px -1px rgba(0, 0, 0, 0.15);
}

.analytics-card h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 8px;
    transition: transform 0.2s ease;
}

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

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.chart-container {
    height: 250px;
    position: relative;
}

.timeline {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 1rem;
}

.timeline-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-left: 2px solid var(--border-color);
    padding-left: 1.5rem;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 1.5rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-color);
}

.timeline-item:last-child {
    border-left: 2px solid transparent;
}

.timeline-content {
    flex: 1;
}

.timeline-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.timeline-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.streak-container {
    text-align: center;
    padding: 1rem;
}

.streak-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.streak-label {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.streak-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    padding: 1rem 0;
}

.calendar-day {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 4px;
    background: var(--bg-color);
    transition: transform 0.2s ease;
}

.calendar-day.active {
    background: var(--primary-color);
}

.calendar-day:hover {
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .analytics-content {
        padding: 1rem !important;
    }

    .analytics-grid {
        grid-template-columns: 1fr;
    }

    .stat-grid {
        grid-template-columns: 1fr;
    }
} 

/* Difficulty Analytics Styles */
.difficulty-stats {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.difficulty-stat {
    background: var(--bg-color);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.difficulty-stat.easy .difficulty-label { color: var(--success-color); }
.difficulty-stat.medium .difficulty-label { color: var(--warning-color); }
.difficulty-stat.hard .difficulty-label { color: var(--danger-color); }

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.difficulty-label {
    font-weight: 600;
    font-size: 0.9rem;
}

.difficulty-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.stat-details {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Progress bars for each difficulty */
.difficulty-stat .progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.difficulty-stat.easy .progress {
    background: linear-gradient(90deg, var(--success-color), #34d399);
}

.difficulty-stat.medium .progress {
    background: linear-gradient(90deg, var(--warning-color), #fbbf24);
}

.difficulty-stat.hard .progress {
    background: linear-gradient(90deg, var(--danger-color), #f87171);
}

/* Difficulty Insights */
.difficulty-insights {
    margin-top: 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.insight-card {
    background: var(--bg-color);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.insight-card h4 {
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.insight-card p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Animation for progress bars */
.difficulty-stat .progress {
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    animation: progressFill 1s ease-out;
    background-size: 200% 100%;
    animation: progressFill 1s ease-out, gradientMove 2s linear infinite;
}

@media (max-width: 768px) {
    .difficulty-insights {
        grid-template-columns: 1fr;
    }
} 

/* Homepage Detailed Stats */
.detailed-stats {
    margin: 2rem 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.stats-section {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.stats-section h3 {
    color: var(--text-primary);
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

/* Homepage Difficulty Stats */
.difficulty-stats .difficulty-stat {
    cursor: pointer;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.difficulty-stats .difficulty-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -6px rgba(var(--primary-color-rgb), 0.15);
}

.difficulty-stats .difficulty-stat::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.difficulty-stats .difficulty-stat:hover::after {
    opacity: 1;
}

.difficulty-stats .difficulty-stat.active {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -6px rgba(var(--primary-color-rgb), 0.2);
    border: 1px solid var(--primary-color);
}

.click-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.difficulty-stat:hover .click-hint {
    opacity: 1;
}

/* Homepage Topic Stats */
.topic-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.topic-stat {
    background: var(--bg-color);
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.topic-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -6px rgba(var(--primary-color-rgb), 0.15);
}

.topic-stat.active {
    background: rgba(var(--primary-color-rgb), 0.05);
    border-color: var(--primary-color);
}

.topic-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.topic-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.topic-count {
    color: var(--text-secondary);
}

.topic-percentage {
    color: var(--primary-color);
    font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .topic-stats {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
} 