/* style.css */
:root {
    /* Solid & Sophisticated Palette */
    --bg-color: #0d0d0d;
    /* Pitch black/Dark Grey matte */
    --panel-bg: #141414;
    /* Solid dark panel */
    --panel-bg-hover: #1f1f1f;

    --text-primary: #ffffff;
    /* Pure white */
    --text-secondary: #9ca3af;
    /* Cool grey */
    --text-tertiary: #4b5563;

    /* Sharp Accents */
    --accent-blue: #2563eb;
    /* Strong professional blue */
    --accent-blue-hover: #1d4ed8;
    --accent-glow: transparent;
    /* Removed glow */

    --accent-gold: #d97706;
    /* Darker, richer gold */
    --danger-color: #dc2626;
    --success-color: #059669;

    /* Structural - High Contrast */
    --border-color: #333333;
    /* Visible, crisp definition */
    --border-hover: #555555;
    --overlay-bg: rgba(0, 0, 0, 0.85);
    /* Darker overlay */

    /* Spacing & Sharpness */
    --header-height: 64px;
    /* Slightly more compact */
    --border-radius: 2px;
    /* Sharp, almost square corners */
    --spacing-md: 16px;
    --spacing-sm: 8px;

    /* Effects - Flat & Clean */
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-glow: none;
    --glass-bg: #141414;
    --backdrop-blur: none;

    /* Standard Colors for Selection */
    --c-red: #ff5252;
    --c-orange: #ff9800;
    --c-amber: #ffc107;
    --c-green: #4caf50;
    --c-teal: #009688;
    --c-blue: #2196f3;
    --c-indigo: #3f51b5;
    --c-purple: #9c27b0;
    --c-pink: #e91e63;
    --c-gray: #607d8b;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    line-height: 1.5;
}

/* Button & Inputs - Unified & Clean */
input,
select,
textarea,
button {
    font-family: inherit;
    font-size: 14px;
}

.input-field {
    width: 100%;
    background-color: #2a2a2a;
    /* Slightly lighter than panel */
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px;
    border-radius: 4px;
    /* Sharp but friendly */
    outline: none;
    transition: border-color 0.2s;
}

.input-field:focus {
    border-color: var(--accent-blue);
}

.btn {
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 8px 16px;
    font-weight: 500;
    transition: all 0.2s ease;
    background-color: #2a2a2a;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn:hover {
    background-color: #333;
    border-color: #444;
}

.btn-primary {
    background-color: var(--accent-blue);
    color: white;
}

.btn-primary:hover {
    background-color: var(--accent-blue-hover);
    border-color: transparent;
}

.btn-danger {
    background-color: rgba(220, 38, 38, 0.1);
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

.btn-danger:hover {
    background-color: var(--danger-color);
    color: white;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 4px;
    border-radius: 4px;
}

.btn-icon:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* Buttons */
.btn {
    cursor: pointer;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--accent-blue);
    color: white;
}

.btn-primary:hover {
    background-color: #5077d6;
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.btn-text {
    background: none;
    color: var(--text-secondary);
}

.btn-text:hover {
    color: var(--accent-gold);
}

.btn-small {
    padding: 4px 8px;
    font-size: 12px;
}

.btn-danger {
    background-color: rgba(255, 107, 107, 0.1);
    color: var(--danger-color);
}

.btn-danger:hover {
    background-color: rgba(255, 107, 107, 0.2);
}

/* Layout */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Header */
.main-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-color);
    /* Seamless header */
}

.header-left {
    display: flex;
    flex-direction: column;
}

.clock-display {
    font-size: 24px;
    font-weight: 300;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.date-display {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.app-title {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--accent-gold);
}

/* Main Content */
/* Main Content */
.main-layout {
    flex: 1;
    display: flex;
    padding: 20px;
    gap: 20px;
    /* More breathing room */
    overflow: hidden;
    background: var(--bg-color);
    /* Flat bg */
}

.panel {
    background-color: var(--panel-bg);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* No shadow, just clean borders */
    transition: border-color 0.2s ease;
}

.panel:hover {
    border-color: var(--border-hover);
}

.global-links-panel {
    flex: 1 1 0px;
    /* Equal width, robust */
    min-width: 0;
}

.right-panel-wrapper {
    flex: 1 1 0px;
    /* Equal width, robust */
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    overflow: hidden;
}

/* Notice Panel - Distinct Design */
.notice-panel {
    flex: 0 0 auto;
    max-height: 40%;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--accent-gold);
    /* Gold border to pop */
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.1);
    /* Subtle gold glow */
}

.notice-panel .panel-header h2 {
    color: var(--accent-gold);
    /* Gold title */
}

.favorites-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.panel-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h2 {
    font-size: 18px;
    font-weight: 500;
}

.subtitle {
    font-size: 12px;
    color: var(--text-secondary);
}

.links-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.notice-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* Accordion & Links */
.folder-item {
    margin-bottom: 16px;
}

.folder-header {
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
}

.folder-header:hover {
    background-color: var(--hover-bg);
}

.folder-icon {
    margin-right: 8px;
    color: var(--accent-gold);
    transition: transform 0.2s;
}

.folder-icon.expanded {
    transform: rotate(90deg);
}

.folder-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
}

.folder-name:hover {
    text-decoration: underline;
    color: var(--accent-blue);
}

.open-all-icon {
    font-size: 11px;
    color: var(--text-secondary);
    margin-left: 8px;
    padding: 2px 6px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    opacity: 0.7;
    transition: all 0.2s;
}

.open-all-icon:hover {
    opacity: 1;
    color: var(--accent-gold);
    border-color: var(--accent-gold);
}

.folder-actions {
    opacity: 0;
    transition: opacity 0.2s;
    margin-left: 8px;
}

.folder-header:hover .folder-actions {
    opacity: 1;
}

.folder-content {
    padding-left: 28px;
    display: none;
}

.folder-content.expanded {
    display: block;
}

.link-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 2px;
    border-radius: var(--border-radius);
    border-bottom: 1px solid #1a1a1a;
    transition: background-color 0.1s ease;
}

.link-item:hover {
    background-color: var(--panel-bg-hover);
    transform: none;
    box-shadow: none;
    border-left: 2px solid var(--accent-blue);
}

.link-checkbox {
    margin-right: 12px;
    cursor: pointer;
    accent-color: var(--accent-gold);
    width: 16px;
    height: 16px;
}

.link-favicon {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    border-radius: 2px;
}

.link-anchor {
    flex: 1;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-anchor:hover {
    color: var(--accent-blue);
}

.link-actions {
    opacity: 0;
    transition: opacity 0.2s;
}

.link-item:hover .link-actions {
    opacity: 1;
}

/* Notices Specific */
.notice-item {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 8px;
    overflow: hidden;
    background-color: #2a2b30;
    /* Slightly lighter than panel bg */
}

.notice-header {
    padding: 12px 14px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
}

.notice-header:hover {
    background-color: var(--hover-bg);
}

.notice-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.notice-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.notice-date {
    font-size: 11px;
    color: var(--text-secondary);
}

.notice-due {
    font-size: 10px;
    color: var(--accent-gold);
    border: 1px solid var(--accent-gold);
    padding: 1px 4px;
    border-radius: 4px;
}

.notice-content {
    padding: 14px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    background-color: var(--panel-bg);
    border-top: 1px solid var(--border-color);
    display: none;
}

.notice-content.expanded {
    display: block;
}

.notice-actions {
    display: flex;
    gap: 4px;
    margin-left: 8px;
}

/* Favorites Specific */
.favorite-item {
    display: flex;
    align-items: center;
    padding: 10px;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 8px;
}

.favorite-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-left: 8px;
}

.fav-link-wrapper {
    display: flex;
    align-items: center;
}

.fav-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
}

.fav-name:hover {
    color: var(--accent-blue);
}

.fav-folder {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.fav-actions {
    display: flex;
    gap: 4px;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

.btn-icon:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.hidden {
    display: none !important;
}

.modal-content {
    background-color: var(--panel-bg);
    padding: 24px;
    border-radius: var(--border-radius);
    width: 320px;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-content h3 {
    margin-bottom: 16px;
    color: var(--text-primary);
}



/* Date Input Styling */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    /* Make calendar icon white */
    cursor: pointer;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.modal-footer-action {
    margin-top: 16px;
    padding-top: 16px;
    background: transparent;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive */
@media (max-width: 768px) {
    .main-layout {
        flex-direction: column;
        overflow-y: auto;
    }

    .panel {
        min-height: 400px;
    }

    .notice-panel {
        max-height: none;
    }

    body {
        overflow: auto;
    }
}

/* Todo Panel Styles */
.todo-panel {
    flex: 1 1 0px;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.todo-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background-color: transparent;
}

.todo-project {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.todo-group {
    margin-bottom: 16px;
}

.todo-group-header {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-blue);
    /* Color pop */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    /* Tighter letter spacing */
    margin-bottom: 8px;
    padding: 4px 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.todo-project-header {
    /* Clean, dark, technical header */
    background: #111 !important;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-blue) !important;
}


.todo-group-header:hover {
    color: var(--accent-blue);
}



.todo-item.completed {
    opacity: 0.6;
    background-color: transparent;
}

.todo-item.completed .todo-text {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.todo-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    /* Fainter border */
    border-radius: 4px;
    margin-right: 12px;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.todo-checkbox:hover {
    border-color: rgba(255, 255, 255, 0.5);
}

.todo-checkbox:checked {
    background-color: var(--accent-blue);
    border-color: var(--accent-blue);
}

.todo-checkbox:checked::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
    /* Slight adjustment for centering */
}

.todo-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.todo-text {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.todo-meta {
    font-size: 10px;
    color: var(--text-secondary);
}

.todo-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.todo-item:hover .todo-actions {
    opacity: 1;
}

/* Drag Styling */
/* Drag Styling */
.todo-item.dragging {
    opacity: 0.5;
    border: 1px dashed var(--accent-blue);
}

.todo-item.drag-over {
    /* border-top: 2px solid var(--accent-blue); Moved to transparent border handling if needed */
    box-shadow: 0 -2px 0 var(--accent-blue);
}

.todo-group.drag-over {
    background-color: rgba(100, 136, 234, 0.1);
    border-radius: 8px;
}

/* Color Picker Styles */
.color-picker-group {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s, border-color 0.2s;
}

.color-swatch:hover {
    transform: scale(1.1);
}

.color-swatch.selected {
    border-color: white;
    box-shadow: 0 0 0 2px var(--accent-blue);
}

/* Todo Items Redesign */
.todo-item {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    background-color: var(--panel-bg);
    /* Default fallback */
    border-radius: 4px;
    margin-bottom: 4px;
    transition: all 0.2s ease;
    border: none;
    /* No border by default */

    /* Dynamic styling handled by inline styles:
       --item-color: #HEX;
       background-color: color-mix(in srgb, var(--item-color) 10%, transparent);
       border-left: 3px solid var(--item-color);
    */
    border-left: 3px solid transparent;
}

.todo-item:hover {
    /* Slightly darken/lighten on hover */
    filter: brightness(1.2);
}

.todo-item.completed {
    opacity: 0.5;
    text-decoration: line-through;
    filter: grayscale(1);
}

/* Due Date Badges */
.todo-due-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    font-weight: 500;
    display: inline-block;
    vertical-align: middle;
}

.todo-memo {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
    display: block;
    line-height: 1.3;
}

.due-overdue {
    background-color: rgba(220, 38, 38, 0.2);
    color: #ff6b6b;
    border: 1px solid rgba(220, 38, 38, 0.4);
}

.due-today {
    background-color: rgba(217, 119, 6, 0.2);
    color: #ffb74d;
    border: 1px solid rgba(217, 119, 6, 0.4);
}

.due-soon {
    background-color: rgba(37, 99, 235, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(37, 99, 235, 0.4);
}

.due-future {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid transparent;
}

/* Urgency Animation */
@keyframes pulse-red {
    0% {
        background-color: rgba(220, 38, 38, 0.1);
        border-color: rgba(220, 38, 38, 0.3);
    }

    50% {
        background-color: rgba(220, 38, 38, 0.3);
        border-color: rgba(220, 38, 38, 0.6);
    }

    100% {
        background-color: rgba(220, 38, 38, 0.1);
        border-color: rgba(220, 38, 38, 0.3);
    }
}

.due-urgent {
    color: #ff6b6b;
    border: 1px solid rgba(220, 38, 38, 0.4);
    animation: pulse-red 2s infinite ease-in-out;
}