/* ============================================================
   HOMEPAGE DASHBOARD — BALANCED THEME
   Compact but maintains premium aesthetics and full functionality
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --glass-bg: rgba(15, 15, 20, 0.6);
    --glass-bg-hover: rgba(25, 25, 30, 0.75);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-border-hover: rgba(255, 255, 255, 0.25);
    --glass-blur: 20px;
    --shadow-base: 0 8px 32px -4px rgba(0, 0, 0, 0.6);
    --shadow-hover: 0 12px 40px -6px rgba(0, 0, 0, 0.7);
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', sans-serif !important;
    background-size: cover !important;
    background-position: center !important;
    background-attachment: fixed !important;
    padding-bottom: 40px !important;
}

/* --- 2. CUSTOM SCROLLBAR --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* --- 3. SERVICE & WIDGET CARDS --- */
.service-card,
.widget-card {
    background-color: var(--glass-bg) !important;
    backdrop-filter: blur(var(--glass-blur)) saturate(180%) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 16px !important;
    box-shadow: var(--shadow-base) !important;
    transition: background-color var(--transition), border-color var(--transition), box-shadow var(--transition) !important;
    position: relative;
    overflow: hidden !important;
    padding: 0.75rem !important;
    /* Balanced padding */
}

.service-card:hover,
.widget-card:hover {
    background-color: var(--glass-bg-hover) !important;
    border-color: var(--glass-border-hover) !important;
}

/* --- 4. TIGHT GROUPING --- */
.group {
    margin-bottom: 1.25rem !important;
}

.group-header {
    margin-bottom: 0 !important;
}

.group-header h2 {
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.12em !important;
    text-transform: uppercase !important;
    color: rgba(255, 255, 255, 0.9) !important;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 0.5rem !important;
}

/* --- 5. STICKY NOTES WIDGET --- */
.custom-notebook-widget {
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 220px;
}

.notebook-tabs {
    display: flex;
    gap: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 0.6rem;
}

.notebook-tab {
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    position: relative;
}

.notebook-tab:hover {
    color: rgba(255, 255, 255, 0.7);
}

.notebook-tab.active {
    color: #fff;
}

.notebook-tab.active::after {
    content: '';
    position: absolute;
    bottom: -0.65rem;
    left: 0;
    width: 100%;
    height: 2px;
    background: #63b3ed;
    box-shadow: 0 0 12px rgba(99, 179, 237, 0.7);
}

.notebook-content {
    flex-grow: 1;
    display: none;
}

.notebook-content.active {
    display: flex;
    flex-direction: column;
}

.todo-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 160px;
    overflow-y: auto;
}

.todo-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.todo-checkbox {
    cursor: pointer;
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 5px;
    position: relative;
}

.todo-checkbox:checked {
    background: #22c55e;
    border-color: #22c55e;
}

.todo-checkbox:checked::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 11px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.notes-textarea {
    width: 100%;
    height: 180px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: #fff;
    padding: 1rem;
    font-size: 0.9rem;
    resize: none;
    line-height: 1.6;
}

/* Footer & Buttons */
.notebook-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.task-count {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 600;
}

.clear-completed {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    background: none;
    border: none;
}

.clear-completed:hover {
    color: #ef4444;
}

.notebook-add-btn {
    background: #63b3ed;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 4px 14px;
    font-weight: 700;
    cursor: pointer;
}

/* Remove internal flex gaps to tighten the specific widget card */
.flex.flex-col:has(.custom-notebook-widget) {
    gap: 0 !important;
}

/* Icon Glows */
img[src*="jellyfin"] {
    filter: drop-shadow(0 0 6px rgba(0, 164, 215, 0.6));
}

img[src*="sonarr"] {
    filter: drop-shadow(0 0 6px rgba(0, 185, 238, 0.55));
}

img[src*="radarr"] {
    filter: drop-shadow(0 0 6px rgba(255, 193, 7, 0.55));
}

/* --- 6. SPARKLINE GRAPHS --- */
.custom-graph-container {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 50px !important;
    pointer-events: none !important;
    z-index: 0 !important;
    opacity: 0.6 !important;
    overflow: hidden !important;
    border-radius: 0 0 16px 16px !important;
}

.sparkline-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.sparkline-path {
    fill: none;
    stroke: #63b3ed;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 4px rgba(99, 179, 237, 0.4));
    transition: d 0.4s ease-in-out;
}