/*
 * @file style.css
 * @description Global styling, variables, layout, animations
 * @scope Global
 */
/* CSS Variables */
/* Local Fonts */
@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'JetBrains Mono';
    src: url('../fonts/JetBrainsMono-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg-app: #0f1115;
    --bg-panel: #181b21;
    --bg-input: #232730;

    --text-primary: #ffffff;
    --text-secondary: #949aa5;
    --text-muted: #5f6570;

    --accent-primary: #3b82f6; /* Blue */
    --accent-primary-glow: rgba(59, 130, 246, 0.4);
    --accent-success: #10b981; /* Green */
    --accent-warning: #f59e0b; /* Amber */
    --accent-danger: #ef4444; /* Red */

    --border: #2d333b;
    --radius-lg: 16px;
    --radius-md: 8px;
    --radius-sm: 4px;

    --font-ui: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

/* Light Mode Overrides */
body.light-mode {
    --bg-app: #f0f2f5;
    --bg-panel: #ffffff;
    --bg-input: #ffffff;

    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    --border: #e2e8f0;

    --accent-primary-glow: rgba(59, 130, 246, 0.12);
}

body.light-mode ::-webkit-scrollbar-thumb {
    background: #cbd5e1;
}

body.light-mode ::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

body.light-mode .timer-docket {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border-color: #e2e8f0;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

body.light-mode #newTaskInput {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #1e293b;
}

body.light-mode ::placeholder {
    color: #94a3b8;
    opacity: 1;
}

body.light-mode .todo-item {
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    border: 1px solid #e2e8f0;
}

body.light-mode .todo-item:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

body.light-mode .history-controls {
    background: #ffffff !important;
    border: 1px solid #e2e8f0;
}

body.light-mode .tabs {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

body.light-mode .tab-btn.active {
    background: #ffffff;
    color: var(--accent-primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
    font-weight: 600;
}

body.light-mode .stat-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

body.light-mode .history-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    margin-bottom: 0.5rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

body.light-mode .history-item:last-child {
    border-bottom: 1px solid #e2e8f0; /* Ensure box style consistency */
}

/* Light Mode Hover Adjustments */
body.light-mode .btn-icon:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

body.light-mode .btn-action-play:hover {
    color: #059669; /* Darker green for hover */
    background: rgba(16, 185, 129, 0.1);
}

body.light-mode .btn-action-journal:hover {
    color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.1);
}

body.light-mode .btn-action-delete:hover {
    color: var(--accent-danger);
    background: rgba(239, 68, 68, 0.1);
}

body.light-mode #themeToggle:hover {
    background: rgba(0, 0, 0, 0.08);
}

body.light-mode .journal-form {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

body.light-mode .input-sm {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #1e293b;
}

body.light-mode .journal-form h4 {
    color: #4b5463;
}

/* Reset & Base */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    background-color: var(--bg-app);
    color: var(--text-primary);
    font-family: var(--font-ui);
    min-height: 55em;
    height: 100vh;
    overflow: scroll;
    display: flex;
    justify-content: center;
}

/* Analytics Chart */
.analytics-container {
    background: var(--bg-input);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.chart-bars {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 120px;
    gap: 4px;
    padding-bottom: 5px;
}

.bar-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
    position: relative;
    cursor: help;
}

.bar {
    width: 60%;
    background: var(--accent-primary);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: height 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    min-height: 2px;
    opacity: 0.8;
}

.bar:hover {
    opacity: 1;
    box-shadow: 0 0 10px var(--accent-primary-glow);
}

.bar-label {
    margin-top: 4px;
    font-size: 0.65rem;
    color: var(--text-muted);
}

body.light-mode .bar {
    background: var(--accent-primary);
    opacity: 0.9;
}

/* Zen Mode */
body.zen-mode .history-panel,
body.zen-mode .todo-panel,
body.zen-mode .logo,
body.zen-mode .header-controls > *:not(#zenModeBtn) {
    display: none !important;
}

body.zen-mode .app-header {
    background: transparent;
    border-bottom: none;
    pointer-events: none; /* Let clicks pass through if needed */
    justify-content: flex-end;
}

body.zen-mode .header-controls {
    pointer-events: auto;
}

body.zen-mode #zenModeBtn {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 100;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

body.zen-mode .app-container {
    justify-content: center;
    align-items: center;
}

body.zen-mode .main-grid {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

body.zen-mode .timer-docket {
    transform: scale(1.2);
    width: 100%;
    max-width: 600px;
}

/* Light Mode Zen Override */
body.light-mode.zen-mode .timer-docket {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
}

body.light-mode.zen-mode #zenModeBtn {
    background: #ffffff;
    color: var(--accent-primary);
}

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
@keyframes slideOutRight { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(50px); } }

.animate-fade-in { animation: fadeIn 0.3s ease-out forwards; }
.animate-slide-up { animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.animate-scale-in { animation: scaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.animate-slide-out { animation: slideOutRight 0.3s ease-in forwards; }

.modal { animation: scaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.modal-overlay { animation: fadeIn 0.2s ease-out forwards; }

/* .todo-item animation handled in JS */
.history-item { animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

/* Utilities */
.hidden { display: none !important; }
.btn {
    cursor: pointer;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.5rem 1rem;
    font-weight: 500;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}
.btn-primary { background: var(--accent-primary); color: white; }
.btn-primary:hover { box-shadow: 0 0 12px var(--accent-primary-glow); }
.btn-secondary { background: rgba(255,255,255,0.1); color: var(--text-primary); }
.btn-secondary:hover { background: rgba(255,255,255,0.15); }
.btn-warning { background: var(--accent-warning); color: black; }
.btn-danger { background: var(--accent-danger); color: white; }

/* ... (keep existing btn classes) ... */

/* Update Slider Track */
input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.2); /* Higher contrast line */
    border-radius: 3px;
}
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); }
.btn-outline:hover { border-color: var(--text-primary); color: var(--text-primary); }
.btn-icon { padding: 0.5rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: transparent; color: var(--text-secondary); }
.btn-icon:hover { background: rgba(255,255,255,0.1); color: white; }
.text-danger { color: var(--accent-danger) !important; }
.btn-text { background: none; border: none; padding: 0; }

/* Layout */
.app-container {
    width: 100%;
    max-width: 1200px;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
}
.header-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.logo { display: flex; align-items: center; gap: 0.75rem; font-weight: 700; font-size: 1.25rem; }

/* Timer Docket (Hero) */
.timer-docket {
    background: linear-gradient(145deg, var(--bg-panel), #1c2026);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    min-height: 180px;
}
.active-task-display .label { font-size: 0.75rem; letter-spacing: 1px; color: var(--accent-primary); font-weight: 600; text-transform: uppercase; margin-bottom: 0.25rem; }
.active-task-display h2 { font-size: 1.25rem; font-weight: 500; color: var(--text-primary); height: 1.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 600px; }

.timer-display {
    font-family: var(--font-mono);
    font-size: 4rem;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 0 20px rgba(255,255,255,0.05);
    margin: 0.5rem 0;
}
.timer-controls { height: 48px; }

/* Main Grid */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    flex: 1;
    min-height: 0; /* Fix flex overflow */
}

/* Panels */
.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.panel-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.panel-header h3 { font-size: 1rem; font-weight: 600; }

.panel-footer {
    padding: 1rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

/* Todo List Styles */
.todo-input-wrapper {
    padding: 1rem;
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border);
}
#newTaskInput {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    color: white;
    font-family: inherit;
}
#newTaskInput:focus { outline: none; border-color: var(--accent-primary); }

.todo-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.todo-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s;
}
.todo-item:hover { background: rgba(255,255,255,0.05); }
.todo-item.active-running { border-color: var(--accent-primary); background: rgba(59, 130, 246, 0.05); }
.todo-item.active-paused { border-color: var(--accent-warning); background: rgba(245, 158, 11, 0.05); }

.todo-title {
    flex: 1;
    font-weight: 500;
    white-space: pre-wrap; /* Respect newlines */
    word-break: break-word; /* Wrap long words */
    min-width: 0; /* Enable flex shrinkage */
    overflow-wrap: break-word; /* Modern equivalent */
}
.todo-actions { display: flex; gap: 0.5rem; }
.btn-action-play { color: var(--accent-success); }
.btn-action-pause { color: var(--accent-warning); }
.btn-action-stop { color: var(--text-secondary); }
.btn-action-stop:hover { color: var(--accent-success); }
.btn-action-delete { color: var(--text-secondary); }
.btn-action-delete:hover { color: var(--accent-danger); }

/* History Styles */
.tabs { display: flex; gap: 0.25rem; background: var(--bg-input); padding: 0.25rem; border-radius: var(--radius-md); }
.tab-btn {
    background: transparent; border: none; color: var(--text-secondary);
    padding: 0.25rem 0.75rem; border-radius: var(--radius-sm); font-size: 0.85rem; cursor: pointer;
}
.tab-btn.active { background: var(--bg-panel); color: var(--text-primary); box-shadow: 0 2px 4px rgba(0,0,0,0.2); }

.stats-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}
.stat-card {
    background: rgba(255,255,255,0.02);
    padding: 0.75rem;
    border-radius: var(--radius-md);
    text-align: center;
}
.stat-label { display: block; font-size: 0.75rem; color: var(--text-secondary); margin-bottom: 0.25rem; }
.stat-value { font-size: 1.25rem; font-weight: 700; }

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    scrollbar-gutter: stable;
}

.history-group-header {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    margin: 1rem 0 0.5rem 0;
    letter-spacing: 0.5px;
}
.history-group-header:first-child { margin-top: 0; }

.history-controls {
    display: flex; align-items: center; gap: 0.5rem;
    background: var(--bg-input);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    flex: 1; justify-content: space-between;
    min-width: 250px;
}

#todayBtn {
    font-size: 0.7rem; padding: 2px 8px; border-radius: 12px; height: 24px;
}

#historyRangeLabel {
    font-size: 0.9rem; font-weight: 600; text-align: center; flex: 1;
}

.history-header-layout {
    flex-direction: column !important; /* Override flex-row if needed or just be specific */
    align-items: stretch !important;
    gap: 1rem;
}

.history-title-row {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
}

.history-tabs-container {
    width: 100%; display: flex; justify-content: center;
}

.tab-btn {
    flex: 1; /* Make them fill width */
    background: transparent; border: none; color: var(--text-secondary);
    padding: 0.25rem 0.75rem; border-radius: var(--radius-sm); font-size: 0.85rem; cursor: pointer;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    cursor: default;
}
.history-item:last-child { border-bottom: none; }
.history-title {
    font-weight: 500;
    flex: 1;
    white-space: pre-wrap;
    word-break: break-word; /* Wrap long words */
    min-width: 0;
    overflow-wrap: break-word;
    margin-right: 1rem; /* Add spacing between title and time */
}
.history-duration { font-family: var(--font-mono); color: var(--text-secondary); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

@media (max-width: 768px) {
    .main-grid { grid-template-columns: 1fr; }
    .app-container { height: auto; overflow-y: auto; }
    body { overflow-y: auto; }
}

/* Modals */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex; justify-content: center; align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}
.modal {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 90%; max-width: 500px;
    max-height: 85vh;
    display: flex; flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.modal-header {
    padding: 1rem; border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
}
.modal-body { padding: 1rem; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 1rem; }

/* Journal Styles */
.journal-controls { display: flex; justify-content: flex-end; }
.journal-list {
    display: flex; flex-direction: column; gap: 0.75rem; flex: 1;
    min-height: 150px;
    max-height: 350px;
    overflow-y: auto;
    padding-right: 5px; /* Space for scrollbar */
}

.journal-entry {
    background: rgba(255,255,255,0.03);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    border-left: 3px solid var(--accent-primary);
}
.journal-meta { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.25rem; display: flex; justify-content: space-between; }
.journal-title { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.25rem; color: var(--text-primary); }
.journal-content { font-size: 0.9rem; color: var(--text-secondary); white-space: pre-wrap; }

.journal-form {
    background: var(--bg-input);
    padding: 1rem;
    border-radius: var(--radius-md);
    display: flex; flex-direction: column; gap: 0.5rem;
}
.journal-form h4 { font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase; }

.input-sm {
    width: 100%; background: var(--bg-app); border: 1px solid var(--border);
    padding: 0.5rem; border-radius: var(--radius-sm); color: var(--text-primary); font-family: inherit;
}
.input-sm:focus { outline: none; border-color: var(--accent-primary); }
.btn-full { width: 100%; justify-content: center; }

.btn-action-journal { color: var(--text-secondary); }
.btn-action-journal:hover { color: var(--accent-primary); }

.journal-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--accent-primary);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 4px;
    pointer-events: none;
}

/* Settings Modal Styles */
.setting-item {
    margin-bottom: 2rem;
    background: rgba(255,255,255,0.03);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.setting-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

input[type="range"] {
    width: 100%;
    margin-top: 0.5rem;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
    height: 6px; /* Taller track target */
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: var(--accent-primary);
    margin-top: -7px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
    transition: transform 0.1s, box-shadow 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.3);
}

input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    background: #4B5563; /* Solid Gray for visibility */
    border-radius: 3px;
}

input[type="range"]::-moz-range-track {
    width: 100%;
    height: 6px;
    background: #4B5563;
    border-radius: 3px;
}

input[type="range"]:focus {
    outline: none;
}
input[type="range"]:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.4);
}

/* Task Menu & Editing Styles */
.task-menu-container {
    position: relative;
    display: inline-block;
}

.task-menu-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    width: 12em;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 50;
    overflow: hidden;
    margin-top: 4px;
    display: none; /* Hidden by default */
}

.task-menu-dropdown.show {
    display: block;
    animation: fadeIn 0.1s ease-out;
}

.task-menu-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s;
}

.task-menu-item:hover {
    background: rgba(255,255,255,0.05);
}

.task-menu-item.danger {
    color: var(--accent-danger);
}
.task-menu-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Light Mode Menu Overrides */
body.light-mode .task-menu-dropdown {
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
body.light-mode .task-menu-item:hover {
    background: #f1f5f9;
}

/* Edit Input */
.task-title-input {
    width: 100%;
    min-height: 8em; /* Approx 5 lines */
    background: var(--bg-input);
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: inherit;
    padding: 0.5rem;
    outline: none;
    resize: vertical; /* Allow resizing if needed */
    line-height: 1.5;
}

.logo-icon {
    width: 2.5rem;
    height: 2.5rem;
    margin-right: 0.5rem;
    border-radius: 6px; /* Smooth rounded edges */
    object-fit: cover;  /* Ensure the image fills the space correctly */
}

/* Priority Badge Styles */
.priority-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 8px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.priority-badge:hover {
    opacity: 0.8;
}

.priority-high {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-danger);
}

.priority-medium {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-warning);
}

.priority-low {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-success);
}

body.light-mode .priority-high {
    background: rgba(239, 68, 68, 0.1);
}

body.light-mode .priority-medium {
    background: rgba(245, 158, 11, 0.1);
}

body.light-mode .priority-low {
    background: rgba(16, 185, 129, 0.1);
}

/* Priority Select Styles */
.priority-select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.25rem 0.35rem;
    color: var(--text-primary);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    height: fit-content;
    align-self: center;
    transition: border-color 0.2s, background 0.2s;
}

.priority-select:focus {
    border-color: var(--accent-primary);
}

body.light-mode .priority-select {
    color: #1e293b;
}

/* History item priority dropdown should not be clickable */
.history-item .priority-select {
    cursor: default;
    pointer-events: none;
    opacity: 0.7;
}

/* Color-coded borders based on current selection */
select.priority-select:has(option[value="high"]:checked) {
    border-color: var(--accent-danger);
    color: var(--accent-danger);
}

select.priority-select:has(option[value="medium"]:checked) {
    border-color: var(--accent-warning);
    color: var(--accent-warning);
}

select.priority-select:has(option[value="low"]:checked) {
    border-color: var(--accent-success);
    color: var(--accent-success);
}

body.light-mode select.priority-select:has(option[value="high"]:checked) {
    background: rgba(239, 68, 68, 0.08);
}

body.light-mode select.priority-select:has(option[value="medium"]:checked) {
    background: rgba(245, 158, 11, 0.08);
}

body.light-mode select.priority-select:has(option[value="low"]:checked) {
    background: rgba(16, 185, 129, 0.08);
}
