/* =========================================================
   1. DASHBOARD HEADER/BOTTOM NAV #e0ebff;
========================================================= */
.hidden { display: none !important; }

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    padding-top: 40px; 
}

/* Håller ihop hälsningen och namnet på en rad */
.greeting-wrapper {
    margin: 0;
    font-size: 1.35em; /* Perfekt H3-storlek för mobilen */
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px; /* Litet mellanrum mellan God morgon och Namnet */
    color: #ffffff;
}

.greeting {
    color: #e0ebff; /* Isig ljusblå */
    font-weight: 600;
}

.firstname {
    font-weight: 800; /* Gör ditt namn lite tjockare så det poppar! */
}

.avatar-placeholder {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #f8fafc;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: rgba(15, 23, 42, 0.7); /* Mörk transparent */
    backdrop-filter: blur(15px); /* Det suddiga glaset! */
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #94a3b8;
    transition: color 0.2s;
}

.nav-item.active, .nav-item:hover {
    color: #ffffff;
}

.nav-item .icon {
    font-size: 1.4rem;
    margin-bottom: 4px;
}

.nav-item .label {
    font-size: 0.7rem;
    font-weight: 600;
}

/* Den stora runda Lägg Till-knappen i mitten */
.main-btn-circle {
    width: 50px;
    height: 50px;
    background: #0056b3;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 86, 179, 0.5);
    margin-top: -10px; /* Lyfter upp knappen lite från botten */
    border: 4px solid #1e3a8a; /* Matchar bakgrunden */
}


/* =========================================================
   2. DASHBOARD WRAPPER & STATUS-WIDGETS
========================================================= */

.dashboard-wrapper {
    padding: 15px 10px;
    max-width: 800px;
    margin: 0 auto;
}

.dash-status {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
}

.status-widget {
    flex: 1;
    background: #ffffff;
    border-radius: 16px;
    padding: 15px 5px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    cursor: pointer;
    border: 2px solid #E3E3E3;
    transition: transform 0.2s, box-shadow 0.2s;
}

.status-widget:hover { 
    transform: translateY(-3px); 
    box-shadow: 0 6px 20px rgba(0,0,0,0.1); 
}

#bibliotek-widget {
    background: linear-gradient(135deg, #2c5e3b 0%, #1e3f28 100%);
}

#bibliotek-widget .widget-text,
#bibliotek-widget .widget-icon {
    color: #ffffff !important;
}

.widget-icon { font-size: 2rem; margin-bottom: 5px; }
.widget-text { font-weight: bold; color: #2c5e3b; font-size: 0.9rem; }
.frost-warning { background: #e0f7fa; border-color: #4dd0e1; }
.frost-warning .widget-text { color: #006064; }

@media (max-width: 600px) {
    .dash-status { flex-wrap: wrap; }
    #weather-widget { flex: 1 1 100%; }
    .status-widget { flex: 1 1 40%; }
}



/* =========================================================
   2. SNABBA ÅTGÄRDER (Swipe-kort)
========================================================= */
.dash-actions {
    margin-bottom: 30px;
}

.swipe-container {
    display: flex;
    gap: 15px;
    padding-bottom: 10px;
}

.swipe-card {
    flex: 1;
    padding: 25px 20px;
    border-radius: 20px;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
    transition: transform 0.2s, box-shadow 0.2s;
}

.swipe-card:hover { 
    transform: translateY(-3px); 
    box-shadow: 0 8px 20px rgba(0,0,0,0.2); 
}

.swipe-card h3 { margin: 0 0 5px 0; font-size: 1.3rem; }
.swipe-card p { margin: 0; opacity: 0.9; font-size: 0.9rem; }

.card-plan, .card-upp { position: relative; }
.card-plan::before {
    content: '‹';
    position: absolute;
    left: 5px; 
    top: 50%;
    transform: translateY(-50%);
    font-size: 48px; 
    color: rgba(255, 255, 255, 0.9);
    pointer-events: none;
}
.card-upp::after {
    content: '›';
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 48px;
    color: rgba(255, 255, 255, 0.9);
    pointer-events: none;
}
.card-plan { padding-left: 45px; }
.card-upp { padding-right: 45px; }

@media (max-width: 650px) {
    .swipe-container {
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }
    .swipe-container::-webkit-scrollbar { display: none; }
    .swipe-card {
        flex: 0 0 82%;
        scroll-snap-align: center;
    }
}

/* =========================================================
   3. AI HERO CARD
========================================================= */
.ai-hero-card {
    color: white;
    padding: 30px 20px;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(44,94,59,0.3);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.ai-hero-card, #dash-btn-ai {
    background: linear-gradient(135deg, #F3E5F5 20%, #8048c4 80%) !important;
    color: #ffffff !important;
}

.ai-hero-card h2, .ai-hero-card p { color: #000000 !important; }
.ai-avatar { font-size: 3rem; margin-bottom: 10px; }
.ai-hero-card h2 { margin: 0 0 10px 0; color: #fff; }
.ai-hero-card p { margin: 0; line-height: 1.5; opacity: 0.9; font-size: 1.05rem; }

/* =========================================================
   4. SIDSTRUKTUR & HEADER
========================================================= */
.page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px 48px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.header-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.header-title h1 { margin: 0; font-size: 28px; font-weight: 600; }
.header-title p { margin: 0; font-size: 14px; color: var(--text-muted); }

.header-actions { display: flex; gap: 12px; }

.btn {
    padding: 8px 14px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* =========================================================
   5. UNIFIERAD SUMMARY GRID (För topp-kort och påminnelser)
========================================================= */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
    padding: 4px;
}

.summary-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 16px 18px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    box-sizing: border-box;
    width: 100%;
}

.summary-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.summary-value {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 4px;
}
.summary-sub {
    font-size: 12px;
    color: var(--text-muted);
}

/* Klick-effekt som fungerar utmärkt på både mobil och dator */
.summary-card:active {
    transform: scale(0.95); /* Knappen trycks in lite lätt vid klick/touch */
    transition: transform 0.1s ease;
}

/* =========================================================
   6. MAIN LAYOUT (Påminnelser & Djuröversikt)
========================================================= */
.main-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card {
    background: #ffffff;
    border-radius: 18px;
    padding: 18px 20px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.card-header h2 { margin: 0; font-size: 18px; font-weight: 600; }
.card-header span { font-size: 12px; color: var(--text-muted); }

.energy-btn {
        flex: 1; text-align: center; padding: 10px 0; background: #f1f5f9; border: 2px solid transparent; 
        border-radius: 8px; cursor: pointer; font-size: 1.2rem; transition: all 0.2s;
    }
    .energy-btn:has(input:checked) {
        background: #e0e7ff; border-color: #4f46e5; transform: scale(1.05);
    }
    .energy-btn input { display: none; }

/* =========================================================
   7. MOBILANPASSNING (Generell layout)
========================================================= */
@media (max-width: 768px) {
    .page { padding: 16px 12px 40px; }

    .header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 20px;
    }

    .header-title h3 {
        margin: 0;
        font-size: 1rem;
        line-height: 1.4;
        color: #475569;
    }

    .header-actions { width: 100%; }
    .header-actions .btn {
        width: 100%;
        justify-content: center;
        min-height: 44px;
        font-size: 1rem;
        font-weight: 600;
    }

    /* Gör om Grid till Svepbar Karusell på mobilen */
    .summary-grid {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 12px;
        padding: 4px 4px 12px 4px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .summary-grid::-webkit-scrollbar { display: none; }
    
    .summary-card {
        flex: 0 0 85%; 
        scroll-snap-align: center; 
        padding: 18px 20px;
        justify-content: center;
    }

    .card {
        padding: 16px 14px;
        border-radius: 16px;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .cw-list-img {
        width: 72px;
        height: 72px;
    }
}

/* För AI input text  
#ai-input-text:focus {
    outline: none; /* Tar bort den fula svarta standardkanten 
    border-color: #4338ca !important; /* Gör själva ramen blå 
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3); /* Skapar en mjuk "halo"-effekt runtom 
}
*/

/* Foder & Medicinschema - Kort */
.feeding-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feeding-header {
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 8px;
}

.feeding-time {
    background: #3b82f6; /* Klassisk AniMate-blå */
    color: white;
    font-weight: bold;
    font-size: 0.85rem;
    padding: 4px 10px;
    border-radius: 20px;
}

.feeding-title {
    font-size: 1.05rem;
    font-weight: bold;
    color: #1e293b;
}

.feeding-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.feeding-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #f8fafc;
    padding: 10px;
    border-radius: 8px;
}

.item-icon {
    font-size: 1.2rem;
}

.item-details {
    font-size: 0.9rem;
    color: #334155;
    line-height: 1.4;
}

.feeding-note {
    font-size: 0.85rem;
    color: #64748b;
    padding: 5px 10px;
    border-left: 3px solid #cbd5e1;
    margin-top: 5px;
}

.feeding-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 5px;
}

.feeding-actions button {
    background: none;
    border: none;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 5px;
    font-weight: bold;
}

/* Styling för Mån-Sön knappar */
.day-toggle input {
    display: none; /* Gömmer den fula standard-kryssrutan */
}

.day-toggle span {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 35px;
    height: 35px;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.day-toggle input:checked + span {
    background: #3b82f6; /* Blå när den är vald */
    color: white;
    border-color: #2563eb;
}

/* Dölj alltid utskriftscontainern på skärmen */
#print-container {
    display: none;
}

/* --- UTSKRIFTSREGLER (Gäller bara när skrivaren jobbar) --- */
@media print {
    @page {
        size: A4 portrait;
        margin: 0.5cm; 
    }

    /* 1. Dölj hela appen, menyer och alla modaler */ 
    body > *:not(#print-container) {
        display: none !important;
    }

    /* 2. Tvinga vit bakgrund på hela papperet */
    body, html {
        background: #ffffff !important;
        margin: 0 !important;
        padding: 0 !important;
        height: auto !important;
    }

    /* 3. Visa utskriftscontainern över hela papperet */
    #print-container {
        display: block !important;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        background: #ffffff !important;
    }

    /* 4. Tvinga ALL text och ALLA rubriker att bli svarta på papperet */
    #print-container * {
        color: #000000 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}
    