:root {
    --card-bg: var(--color-bg-sidebar);
    --card-border: var(--color-border-hr);
    --text-main: var(--color-text-primary);
    --text-muted: var(--color-text-placeholder);
    --accent: #695CFE;
    --accent-soft: rgba(105, 92, 254, 0.12);
}

/* Dark theme overrides for study page */
body.dark-theme {
    --card-bg: #1f2937;
    --card-border: #3B475C;
    --text-main: #F1F5F9;
    --text-muted: #A6B7D2;
}

.study-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}

.study-stats-mini {
    display: flex;
    gap: 1.5rem;
}

.stat-mini {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--color-surface-container);
    border-radius: 12px;
    border: 1px solid var(--card-border);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

.study-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge {
    background: var(--color-bg-secondary);
    color: var(--text-main);
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    font-size: 0.9rem;
    border: 1px solid var(--card-border);
}

.study-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.25rem;
    align-items: start;
}

.study-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.study-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.featured-card {
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(105, 92, 254, 0.03) 100%);
    border: 2px solid rgba(105, 92, 254, 0.2);
}

.timer-circle {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 1.5rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timer-ring {
    position: absolute;
    transform: rotate(-90deg);
}

.timer-ring-bg {
    fill: none;
    stroke: var(--color-bg-secondary);
    stroke-width: 8;
}

.timer-ring-progress {
    fill: none;
    stroke: var(--accent);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 565.48;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.3s ease;
}

.timer-display {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-main);
    position: absolute;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--accent-soft);
    color: var(--accent);
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    font-weight: 600;
    border: 1px solid rgba(105, 92, 254, 0.2);
    font-size: 0.85rem;
}

.chip.subtle {
    background: var(--color-bg-secondary);
    color: var(--text-muted);
    border-color: var(--card-border);
}

.timer-meta {
    display: flex;
    gap: 1.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    align-items: center;
    justify-content: center;
    margin: 1rem 0;
}

.timer-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.timer-controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1.25rem 0;
}

.secondary-controls {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.primary-btn,
.ghost-btn,
.tiny-btn {
    border: none;
    cursor: pointer;
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.primary-btn {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 12px rgba(105, 92, 254, 0.3);
}

.primary-btn:hover { 
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(105, 92, 254, 0.4);
}

.large-btn {
    font-size: 1.1rem;
    padding: 1rem 2rem;
}

.ghost-btn {
    background: var(--color-bg-secondary);
    color: var(--text-main);
    border: 1px solid var(--card-border);
    padding: 0.5rem;
    width: 48px;
    height: 48px;
}

.ghost-btn:hover { 
    background: var(--color-hover-secondary);
    border-color: var(--accent);
}

.tiny-btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    background: var(--color-bg-secondary);
    color: var(--text-main);
    border: 1px solid var(--card-border);
}

.timer-settings {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

.timer-settings label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.75rem;
    background: var(--color-bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--card-border);
}

.timer-settings input {
    width: 50px;
    padding: 0.4rem 0.5rem;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: var(--color-bg-primary);
    color: var(--text-main);
    font-weight: 600;
    text-align: center;
}

.timer-settings .unit {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.timer-progress {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: var(--color-bg-secondary);
    margin-top: 0.85rem;
    overflow: hidden;
}

.timer-progress-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--accent), #4f9bff);
    transform-origin: left;
    transform: scaleX(1);
    transition: transform 0.25s ease;
}

.task-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.task-form input {
    flex: 1;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--card-border);
    background: var(--color-bg-primary);
    color: var(--text-main);
}

.task-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0;
    margin: 0;
}

.task-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--card-border);
    background: var(--color-bg-primary);
}

.task-list li.done {
    opacity: 0.65;
    text-decoration: line-through;
}

.task-actions {
    display: flex;
    gap: 0.35rem;
}

.task-actions button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 6px;
}

.task-actions button:hover { background: var(--color-bg-secondary); }

.notes-card textarea {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    padding: 0.85rem;
    background: var(--color-bg-primary);
    color: var(--text-main);
    resize: vertical;
}

.session-log {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.session-log li {
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--card-border);
    background: var(--color-bg-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-main);
}

.session-log .time {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.resource-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.pill-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    background: var(--color-bg-secondary);
    color: var(--text-main);
    border: 1px solid var(--card-border);
    text-decoration: none;
    transition: background 0.2s ease;
}

.pill-link:hover { background: var(--color-hover-secondary); }

.tips-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--card-border);
}

.tips-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.75rem;
}

.tip-card {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--color-bg-secondary);
    border-radius: 10px;
    margin-bottom: 0.5rem;
    border: 1px solid var(--card-border);
}

.tip-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.tip-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.5;
}

.tips {
    color: var(--text-muted);
    display: grid;
    gap: 0.35rem;
    font-size: 0.95rem;
}

.empty {
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .study-header { flex-direction: column; align-items: flex-start; }
    .timer-settings { grid-template-columns: 1fr; }
    .timer-controls { flex-direction: column; align-items: stretch; }
    .task-form { flex-direction: column; }
}
