/* ═══════════════════════════════════════════════════════════════
   Family-Dashboard — core.css
   Shared Styles für alle Widgets
   ═══════════════════════════════════════════════════════════════ */

/* ── Reset & Base ────────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #141824;
    --bg2: #1c2333;
    --card: #252d3d;
    --card-hover: #2a3447;
    --border: #2d3a50;
    --border-light: #3a4a63;
    --cyan: #38bdf8;
    --gold: #fbbf24;
    --green: #4ade80;
    --red: #f87171;
    --orange: #fb923c;
    --text: #f1f5f9;
    --muted: #94a3b8;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Layout ──────────────────────────────────────────────────── */
.header {
    background: var(--bg2);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.logo { font-size: 1.3rem; font-weight: 700; color: var(--cyan); }

.user-avatars { display: flex; }

.avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 600;
    border: 2px solid var(--bg2);
    margin-left: -8px;
    cursor: pointer;
    transition: all 0.2s;
}
.avatar:hover { transform: scale(1.1); box-shadow: 0 0 8px currentColor; }
.avatar.active { box-shadow: 0 0 0 3px var(--cyan); transform: scale(1.15); z-index: 10; }

.main-container {
    display: grid;
    grid-template-columns: 360px 1fr 240px;
    flex: 1;
    overflow: hidden;
}

.sidebar-left {
    background: var(--bg2);
    border-right: 1px solid var(--border);
    padding: 20px;
    overflow-y: auto;
}

.sidebar-right {
    background: var(--bg2);
    border-left: 1px solid var(--border);
    padding: 20px;
    overflow-y: auto;
}

.content-center {
    padding: 24px;
    overflow-y: auto;
}

.content-header {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.content-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 4px; }
.content-subtitle { color: var(--muted); font-size: 0.9rem; }

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}
.btn:hover { border-color: var(--cyan); }

.btn-primary {
    background: var(--cyan);
    border-color: var(--cyan);
    color: var(--bg);
    font-weight: 600;
}

/* ── Cards & Widgets ─────────────────────────────────────────── */
.sidebar-widget {
    background: var(--card);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.sidebar-widget-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--cyan);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.overview-widget {
    background: var(--card);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ── Event Cards ─────────────────────────────────────────────── */
.event-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg2);
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}
.event-card:hover {
    background: var(--card-hover);
    border-color: var(--border-light);
    transform: translateX(2px);
}

.event-badge {
    min-width: 44px; height: 44px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
    border: 2px solid;
}
.event-badge-soon { border-color: var(--orange); color: var(--orange); box-shadow: 0 0 8px rgba(251,146,60,0.2); }
.event-badge-week { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 8px rgba(251,191,36,0.2); }
.event-badge-day { border-color: var(--red); color: var(--red); box-shadow: 0 0 8px rgba(248,113,113,0.2); }

.event-info { flex: 1; min-width: 0; }
.event-title { font-size: 0.9rem; font-weight: 500; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-time { font-size: 0.75rem; color: var(--muted); }

/* ── Task Styles ─────────────────────────────────────────────── */
.task-item {
    background: var(--bg2);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
}
.task-item:hover { background: #232f3e; }

.task-check {
    width: 28px; height: 28px;
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.8rem;
}
.task-check:hover { border-color: var(--green); }

.task-item.done .task-check { background: var(--green); border-color: var(--green); color: var(--bg); }
.task-item.done .task-title { text-decoration: line-through; color: var(--muted); }

.task-content { flex: 1; min-width: 0; }
.task-title { font-size: 1rem; font-weight: 500; }

.task-meta {
    display: flex;
    gap: 10px;
    margin-top: 4px;
    font-size: 0.8rem;
    color: var(--muted);
    flex-wrap: wrap;
}

.task-due { display: flex; align-items: center; gap: 4px; }
.task-due.overdue { color: var(--red); }
.task-due.today { color: var(--orange); }
.task-due.soon { color: var(--gold); }

.task-badge { padding: 2px 8px; border-radius: 6px; font-size: 0.75rem; font-weight: 500; }
.task-badge.conny { background: rgba(0,212,255,0.2); color: var(--cyan); }
.task-badge.nino { background: rgba(0,255,136,0.2); color: var(--green); }
.task-badge.christian { background: rgba(255,215,0,0.2); color: var(--gold); }
.task-badge.alle { background: rgba(255,71,87,0.2); color: var(--red); }

.task-priority { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.task-priority.high { background: var(--red); }
.task-priority.medium { background: var(--gold); }
.task-priority.low { background: var(--cyan); }

.task-recurrence {
    font-size: 0.7rem;
    padding: 2px 6px;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    color: var(--muted);
}

/* ── Meal Styles ─────────────────────────────────────────────── */
.meal-widget-card {
    background: var(--bg2);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 8px;
}

.meal-label {
    font-size: 0.7rem;
    color: var(--cyan);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.meal-name { font-size: 1rem; font-weight: 500; }

/* ── Forms ───────────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-label { font-size: 0.8rem; color: var(--muted); margin-bottom: 4px; display: block; }

.form-input {
    width: 100%;
    background: var(--bg2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
}
.form-input:focus { outline: none; border-color: var(--cyan); }

.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

/* ── Selectors ───────────────────────────────────────────────── */
.selector-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.selector-btn {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg2);
    color: var(--text);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}
.selector-btn.selected { border-color: var(--cyan); background: rgba(0,212,255,0.1); }

.priority-btns { display: flex; gap: 8px; }
.priority-btn {
    flex: 1;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg2);
    color: var(--text);
    cursor: pointer;
    font-size: 0.8rem;
    text-align: center;
    transition: all 0.2s;
}
.priority-btn.selected { border-color: var(--cyan); background: rgba(0,212,255,0.1); }
.priority-btn[data-priority="high"] { border-color: var(--red); }
.priority-btn[data-priority="high"].selected { background: rgba(255,71,87,0.1); }
.priority-btn[data-priority="low"] { border-color: var(--cyan); }
.priority-btn[data-priority="low"].selected { background: rgba(0,212,255,0.1); }

/* ── Modals ──────────────────────────────────────────────────── */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}

.modal-content {
    background: var(--card);
    border-radius: 16px;
    padding: 24px;
    width: 100%;
    max-width: 450px;
    border: 1px solid var(--border);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-title { font-size: 1.2rem; font-weight: 600; margin-bottom: 20px; }

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}
.modal-actions button {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: 'Inter', sans-serif;
}

/* ── States ───────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-icon { font-size: 2.5rem; margin-bottom: 10px; }

.loading { text-align: center; padding: 40px; color: var(--muted); }
.spinner {
    width: 24px; height: 24px;
    border: 2px solid var(--card);
    border-top-color: var(--cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.upcoming-empty { font-size: 0.85rem; color: var(--muted); text-align: center; padding: 10px 0; }

.section-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    margin: 20px 0 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.section-title:first-of-type { margin-top: 0; }

/* ── Quick Actions / Sidebar Right ───────────────────────────── */
.quick-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--cyan);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.quick-section { margin-bottom: 20px; }

.quick-item {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
    font-size: 0.9rem;
}
.quick-item:hover { background: var(--card); }
.quick-item.active { background: var(--card); color: var(--cyan); }
.quick-item .icon { font-size: 1rem; }
.quick-item .count {
    margin-left: auto;
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    color: var(--muted);
}

/* ── Bottom Navigation ───────────────────────────────────────── */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--bg2);
    border-top: 1px solid var(--border);
    padding: 10px 0;
    z-index: 50;
}

.bottom-nav-items { display: flex; justify-content: space-around; }

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: var(--muted);
    font-size: 0.65rem;
    cursor: pointer;
}
.bottom-nav-item.active { color: var(--cyan); }
.bottom-nav-item .icon { font-size: 1.2rem; }

/* ── Hamburger ───────────────────────────────────────────────── */
.hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
    margin-right: 12px;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1023px) {
    .main-container { grid-template-columns: 360px 1fr; }
    .sidebar-right { display: none; }
}

@media (max-width: 767px) {
    .main-container { grid-template-columns: 1fr; }
    .sidebar-left {
        position: fixed;
        left: -360px;
        top: 0;
        height: 100vh;
        z-index: 200;
        transition: left 0.3s;
        width: 360px;
    }
    .sidebar-left.open { left: 0; }
    .sidebar-right { display: none; }
    .content-center { padding: 16px; padding-bottom: 70px; }
    .bottom-nav { display: block; }
    .hamburger { display: block; }
}

@media (min-width: 768px) {
    .bottom-nav { display: none; }
}

/* ── Content Body (Main Area Container) ──────────────────────── */
.content-body {
    background: var(--card);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border);
}

/* ── Task Edit Button ──────────────────────────────────────── */
.task-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.task-edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 4px 6px;
    border-radius: 6px;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
}

.task-item:hover .task-edit-btn {
    opacity: 0.6;
}

.task-item:hover .task-edit-btn:hover {
    opacity: 1;
    background: var(--bg2);
}

.task-item.done .task-edit-btn {
    display: none;
}
