/* ============================================
   FAMILY DASHBOARD — Styles
   ============================================ */

.dashboard-body {
    display: flex;
    min-height: 100vh;
    background: var(--cream);
}

/* Sidebar */
.sidebar {
    width: 240px;
    background: var(--white);
    border-right: 2px solid var(--pink-light);
    display: flex;
    flex-direction: column;
    padding: var(--space-lg) 0;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    box-shadow: 4px 0 20px var(--shadow-soft);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0 var(--space-lg);
    margin-bottom: var(--space-xl);
}

.brand-heart {
    font-size: 1.5rem;
    color: var(--pink-deep);
    animation: heartbeat 2s ease-in-out infinite;
}

.brand-text {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 12px var(--space-lg);
    text-decoration: none;
    color: var(--text-mid);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background: var(--lavender-light);
    color: var(--lavender-deep);
}

.sidebar-link.active {
    background: linear-gradient(90deg, var(--pink-light), transparent);
    color: var(--pink-deep);
    border-left-color: var(--pink-deep);
}

.link-icon {
    font-size: 1.2rem;
}

.sidebar-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--pink-light);
}

.sidebar-back {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

.sidebar-back:hover {
    color: var(--lavender-deep);
}

/* Main Content */
.dashboard-main {
    flex: 1;
    margin-left: 240px;
    padding: var(--space-xl);
    max-width: 1200px;
}

/* Header */
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 2px solid var(--pink-light);
}

.dashboard-title {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--text-dark);
}

.dashboard-subtitle {
    font-family: var(--font-body);
    color: var(--text-light);
    margin-top: 4px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.connection-status {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-mid);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-dot.online {
    background: var(--mint-deep);
    box-shadow: 0 0 8px rgba(109, 213, 176, 0.6);
    animation: pulse 2s ease-in-out infinite;
}

.header-avatar {
    width: 44px;
    height: 44px;
    background: var(--lavender-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    border: 2px solid var(--lavender-mid);
}

/* Dashboard Sections */
.dashboard-section {
    display: none;
    animation: fadeInUp 0.5s ease-out;
}

.dashboard-section.active {
    display: block;
}

.section-heading {
    font-family: var(--font-display);
    font-size: 1.6rem;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.section-desc {
    font-family: var(--font-body);
    color: var(--text-light);
    margin-bottom: var(--space-xl);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    box-shadow: 0 4px 20px var(--shadow-soft);
    border: 1px solid var(--pink-light);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-icon {
    font-size: 2rem;
}

.stat-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 2px;
}

.stat-badge {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--font-heading);
}

.stat-badge.good {
    background: var(--mint-light);
    color: #2d8a5e;
}

.stat-badge.warning {
    background: var(--yellow-light);
    color: #b8860b;
}

.stat-badge.danger {
    background: #fff0f0;
    color: #cc0000;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
}

.panel {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: 0 4px 20px var(--shadow-soft);
    border: 1px solid var(--pink-light);
}

.panel-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--lavender-light);
}

/* Timeline */
.timeline {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
}

.timeline-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-top: 4px;
    flex-shrink: 0;
}

.timeline-dot.green { background: var(--mint-deep); }
.timeline-dot.blue { background: var(--sky-mid); }
.timeline-dot.purple { background: var(--lavender-deep); }
.timeline-dot.pink { background: var(--pink-deep); }
.timeline-dot.orange { background: var(--peach-deep); }

.timeline-time {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 600;
}

.timeline-content p {
    font-size: 0.9rem;
    color: var(--text-mid);
    margin-top: 2px;
}

/* Alerts */
.alerts-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.alert-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    transition: background 0.3s ease;
}

.alert-item:hover {
    background: var(--cream);
}

.alert-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.alert-text {
    font-size: 0.9rem;
    color: var(--text-dark);
    font-weight: 500;
}

.alert-time {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 2px;
}

/* Vitals */
.vitals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-lg);
}

.vital-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: 0 4px 20px var(--shadow-soft);
    border: 1px solid var(--pink-light);
    text-align: center;
}

.vital-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.vital-header h4 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    color: var(--text-mid);
}

.vital-value {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: var(--space-md);
}

.vital-value small {
    font-size: 1rem;
    color: var(--text-light);
    font-weight: 400;
}

.vital-chart {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 6px;
    height: 60px;
    margin-bottom: var(--space-md);
}

.chart-bar {
    width: 20px;
    background: var(--lavender-light);
    border-radius: 4px 4px 0 0;
    transition: background 0.3s ease;
}

.chart-bar.active {
    background: linear-gradient(180deg, var(--lavender-mid), var(--pink-mid));
}

.vital-status {
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--font-heading);
    padding: 4px 12px;
    border-radius: var(--radius-full);
}

.vital-status.good {
    background: var(--mint-light);
    color: #2d8a5e;
}

.vital-status.warning {
    background: var(--yellow-light);
    color: #b8860b;
}

/* Reminders */
.reminders-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
}

.reminder-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.reminder-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: 0 2px 10px var(--shadow-soft);
    border: 1px solid var(--pink-light);
}

.reminder-item.completed {
    opacity: 0.7;
}

.reminder-check {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--mint-mid);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.pending-dot {
    background: var(--lavender-light);
    border: 2px solid var(--lavender-mid);
}

.reminder-info {
    flex: 1;
}

.reminder-info h4 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    color: var(--text-dark);
}

.reminder-info p {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 2px;
}

.reminder-time-badge {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-mid);
    padding: 4px 10px;
    background: var(--cream);
    border-radius: var(--radius-full);
}

.reminder-time-badge.upcoming {
    background: var(--yellow-light);
    color: #b8860b;
}

/* Form Styles */
.add-reminder-form {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: 0 4px 20px var(--shadow-soft);
    border: 1px solid var(--pink-light);
}

.add-reminder-form h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: var(--space-lg);
}

.form-group {
    margin-bottom: var(--space-md);
}

.form-group label {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-mid);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--lavender-light);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-dark);
    transition: border-color 0.3s ease;
    background: var(--cream);
}

.form-input:focus {
    outline: none;
    border-color: var(--lavender-mid);
    background: var(--white);
}

.form-input.small {
    width: auto;
    min-width: 120px;
}

.form-row {
    display: flex;
    gap: var(--space-md);
}

.form-row .form-group {
    flex: 1;
}

/* Messages */
.messages-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
}

.message-compose {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: 0 4px 20px var(--shadow-soft);
    border: 1px solid var(--pink-light);
}

.message-textarea {
    width: 100%;
    padding: var(--space-md);
    border: 2px solid var(--lavender-light);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-dark);
    resize: vertical;
    background: var(--cream);
    transition: border-color 0.3s ease;
    margin-bottom: var(--space-md);
}

.message-textarea:focus {
    outline: none;
    border-color: var(--lavender-mid);
    background: var(--white);
}

.message-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.message-option {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.9rem;
    color: var(--text-mid);
    cursor: pointer;
}

.message-option input[type="checkbox"] {
    accent-color: var(--lavender-deep);
}

.message-history {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.message-history h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: var(--space-sm);
}

.message-item {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    box-shadow: 0 2px 10px var(--shadow-soft);
    border: 1px solid var(--pink-light);
}

.message-sender {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--lavender-deep);
    margin-bottom: 4px;
}

.message-item p {
    font-size: 0.95rem;
    color: var(--text-dark);
    font-style: italic;
    margin-bottom: 6px;
}

.message-timestamp {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Photos */
.photos-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--space-xl);
}

.upload-zone {
    background: var(--white);
    border: 3px dashed var(--lavender-mid);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl) var(--space-lg);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-zone:hover {
    border-color: var(--pink-mid);
    background: var(--pink-light);
}

.upload-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: var(--space-md);
}

.upload-zone p {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-mid);
}

.upload-zone small {
    color: var(--text-light);
    font-size: 0.8rem;
}

.photo-gallery h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: var(--space-md);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

.gallery-item {
    background: linear-gradient(135deg, var(--lavender-light), var(--pink-light));
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    text-align: center;
    border: 2px solid var(--white);
    box-shadow: 0 4px 15px var(--shadow-soft);
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.05);
}

.gallery-item-real {
    padding: 0;
    overflow: hidden;
}

.gallery-img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.gallery-item-real span {
    display: block;
    padding: 8px;
}

.gallery-placeholder {
    font-size: 2.5rem;
    margin-bottom: var(--space-sm);
}

.gallery-item span {
    font-size: 0.8rem;
    color: var(--text-mid);
    font-weight: 600;
}

/* Routine */
.routine-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
}

.routine-schedule {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: 0 4px 20px var(--shadow-soft);
    border: 1px solid var(--pink-light);
}

.routine-schedule h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: var(--space-lg);
}

.routine-timeline {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.routine-block {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 10px var(--space-md);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.routine-block.morning { background: var(--yellow-light); }
.routine-block.day { background: var(--mint-light); }
.routine-block.afternoon { background: var(--peach); }
.routine-block.evening { background: var(--lavender-light); }

.routine-time {
    font-weight: 600;
    color: var(--text-dark);
    min-width: 130px;
    font-size: 0.8rem;
}

.routine-activity {
    color: var(--text-mid);
}

.routine-settings {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: 0 4px 20px var(--shadow-soft);
    border: 1px solid var(--pink-light);
}

.routine-settings h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: var(--space-lg);
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--cream);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-info h4 {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    color: var(--text-dark);
}

.setting-info p {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 2px;
}

/* Toggle Switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--lavender-light);
    border-radius: var(--radius-full);
    transition: 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle input:checked + .toggle-slider {
    background: linear-gradient(135deg, var(--mint-mid), var(--mint-deep));
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(22px);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .content-grid,
    .reminders-container,
    .messages-container,
    .routine-container {
        grid-template-columns: 1fr;
    }

    .photos-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 60px;
        padding: var(--space-md) 0;
    }

    .brand-text,
    .link-text,
    .sidebar-footer {
        display: none;
    }

    .sidebar-brand {
        justify-content: center;
        padding: 0;
    }

    .sidebar-link {
        justify-content: center;
        padding: 12px;
    }

    .dashboard-main {
        margin-left: 60px;
        padding: var(--space-lg);
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
