﻿/* =========================================================
   GLOBAL THEME (Web + MAUI) — NewHoro Day-Light Palette
   (Class names unchanged from your original)
   ========================================================= */
:root {
    /* NewHoro palette */
    --bg: #FFF9F3;
    --ink: #1D2A39;
    --muted: #6F7A88;
    --accent: #FF8E3C; /* orange */
    --accent-2: #FFC145; /* saffron */
    /* Your brand family preserved */
    --brown-dark: #4a2f1b;
    --brown-main: #6f4e37;
    --brown-soft: #a67c52;
    /* Surfaces */
    --tan-bg: #FFE5B4; /* Tangerine tint (your preference) */
    --card-bg: #FFFFFF; /* pure white */
    --card-soft: #FFF9F3; /* soft chip surface */
    --table-bg: #fffdf9;
    /* Lines & shadows */
    --border: #E8E2DA; /* softer neutral (was rgba brown) */
    --ring: rgba(255,142,60,0.32);
    --shadow: 0 10px 30px rgba(30,20,10,.07);
    --shadow-strong: 0 18px 44px rgba(30,20,10,.12);
    /* Radii */
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
}

/* Optional global aura (safe) */
html, body {
    background: radial-gradient(900px 200px at 10% 0%, rgba(255,142,60,0.15), transparent 60%), radial-gradient(700px 180px at 90% 0%, rgba(255,193,69,0.15), transparent 60%), var(--bg);
    color: var(--ink);
    overflow-x: hidden;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* =========================================================
   WRAPPER + COMMON  (chip‑panel feel)
   ========================================================= */
.horo-wrapper {
    width: 100%;
    padding: 0;
    margin: 0;
    background: radial-gradient(900px 200px at 10% 0%, rgba(255,142,60,0.15), transparent 60%), radial-gradient(700px 180px at 90% 0%, rgba(255,193,69,0.15), transparent 60%), var(--bg);
}

/* =========================================================
   HEADERS
   ========================================================= */
.horo-title {
    color: var(--ink);
    font-weight: 900;
    font-size: clamp(1.4rem, 4vw, 2rem);
    margin-bottom: 4px;
    letter-spacing: .4px;
}

.horo-subtitle {
    color: var(--muted);
    font-size: clamp(.9rem, 2vw, 1rem);
    margin: 0;
}

/* =========================================================
   BADGES / BUTTON PILLS (chips like NewHoro)
   ========================================================= */
.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .45rem .9rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--card-soft);
    color: var(--ink);
    font-weight: 800;
    font-size: .9rem;
    line-height: 1;
    cursor: default;
    transition: border-color .18s ease, box-shadow .18s ease, transform .1s ease, background .18s ease;
    user-select: none;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
}

    .badge-pill.is-on {
        background: var(--tan-bg);
        border-color: color-mix(in oklab, var(--accent) 24%, var(--border));
    }

    .badge-pill.is-off {
        background: color-mix(in oklab, var(--card-soft) 70%, #fff);
        border-color: var(--border);
    }

    /* Hover ring only */
    .badge-pill:hover {
        border-color: var(--accent);
        box-shadow: 0 0 0 3px var(--ring);
        background: inherit;
    }

    .badge-pill:focus-visible {
        outline: 2px solid var(--accent-2);
        outline-offset: 2px;
    }

    .badge-pill:active {
        transform: scale(0.98);
    }

    .badge-pill.btn-sm {
        padding: .3rem .65rem;
        font-size: .82rem;
    }

/* =========================================================
   CARDS (NewHoro depth)
   ========================================================= */
.horo-card {
    width: 100%;
    max-width: none;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 16px 0;
}

    .horo-card:hover {
        transform: translateY(-3px);
        box-shadow: var(--shadow-strong);
        border-color: color-mix(in oklab, var(--accent) 18%, var(--border));
    }

/* =========================================================
   TABLES — BASE (sticky header + zebra + tags friendly)
   ========================================================= */
.horo-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--border);
    background: var(--table-bg);
    font-size: .95rem;
    border-radius: var(--radius-md);
    overflow: hidden; /* keep rounded corners */
    box-shadow: 0 4px 14px rgba(0,0,0,.06);
}

    .horo-table th,
    .horo-table td {
        border: 1px solid rgba(74, 47, 27, 0.12);
        padding: .65rem .75rem;
        text-align: center;
        vertical-align: middle;
        color: var(--ink);
    }

    .horo-table thead th {
        position: sticky;
        top: 0;
        z-index: 1;
        background: linear-gradient(180deg, #f9efe4, #efe3d5);
        color: var(--ink);
        font-weight: 900;
        letter-spacing: .2px;
        border-bottom: 2px solid color-mix(in oklab, var(--accent) 24%, var(--border));
    }

    /* Emphasis on first column */
    .horo-table td:first-child {
        font-weight: 900;
        color: var(--brown-main);
        background: #fff8ef;
    }

    /* Zebra rows */
    .horo-table tbody tr:nth-child(odd) {
        background: #fffaf4;
    }

    /* Row hover (non-click) */
    .horo-table tbody tr {
        transition: background .18s ease;
        cursor: default;
    }

        .horo-table tbody tr:hover {
            background: rgba(111, 78, 55, 0.05);
        }

        /* Selected row highlight */
        .horo-table tbody tr.is-selected {
            background: var(--tan-bg);
            box-shadow: inset 0 0 0 2px rgba(111, 78, 55, 0.15);
        }

/* Subtable differentiation */
.horo-subtable {
    background: #fffefb;
    border-color: rgba(111, 78, 55, 0.22);
}

    .horo-subtable thead th {
        background: linear-gradient(180deg, #fff3e1, #f7ead9);
        border-bottom: 2px solid rgba(166,124,82,0.6);
    }

    .horo-subtable tbody tr:nth-child(odd) {
        background: #fffaf2;
    }

/* Responsive container for wide tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* =========================================================
   UTILITIES & RESPONSIVE
   ========================================================= */
.before-birth-blur {
    opacity: .5;
    filter: blur(1px);
}

/* Inputs inside cards (optional harmony for forms) */
.horo-card input,
.horo-card select,
.horo-card textarea {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    transition: border-color .18s ease, box-shadow .18s ease;
}

    .horo-card input:focus,
    .horo-card select:focus,
    .horo-card textarea:focus {
        border-color: var(--accent);
        box-shadow: 0 0 0 3px var(--ring);
        outline: none;
    }

/* Mobile compactness */
@media (max-width: 576px) {
    .horo-wrapper {
        padding: .75rem;
        border-radius: var(--radius-md);
    }

    .horo-card {
        padding: .75rem;
    }

    .horo-table td, .horo-table th {
        padding: .35rem;
        font-size: .8rem;
    }

    .badge-pill {
        padding: .35rem .7rem;
        font-size: .85rem;
    }
}




/* =========================================================
   SHODASHVARGA CHARTS — 2×2 Grid (MAUI + Web Responsive)
   ========================================================= */

/* Section heading */
.section-title {
    color: var(--ink);
    font-weight: 900;
    letter-spacing: .3px;
    margin: 0;
}

/* ======= ALWAYS 2 COLUMNS on WEB + MAUI TABLET + MAUI PHONE ======= */
.mahadasha-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 14px !important;
    align-items: stretch;
    width: 100%;
}

    /* Chart card (premium NewHoro look) */
    .mahadasha-grid .horo-card {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        padding: 14px !important;
        background: var(--card-bg);
        border: 1px solid var(--border);
        border-radius: 14px;
        box-shadow: 0 4px 16px rgba(0,0,0,.06);
        transition: transform .18s, box-shadow .18s, border-color .18s;
    }

        .mahadasha-grid .horo-card:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow);
            border-color: color-mix(in oklab, var(--accent) 25%, var(--border));
        }

        /* Title inside each chart card */
        .mahadasha-grid .horo-card h6 {
            margin: 0 0 4px 0 !important;
            color: var(--ink);
            font-weight: 800;
        }

/* ======= Image Improvements (crisp, proportional, centered) ======= */
.chart-img {
    width: 128px !important;
    height: auto !important;
    max-height: 128px;
    object-fit: contain;
    image-rendering: crisp-edges;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 4px 14px rgba(0,0,0,.06);
    transition: transform .15s, box-shadow .2s, border-color .2s;
}

.mahadasha-grid .horo-card:hover .chart-img {
    transform: translateY(-2px) scale(1.03);
    box-shadow: var(--shadow);
    border-color: color-mix(in oklab, var(--accent) 24%, var(--border));
}

/* =================================================================
   MAUI → Mobile Devices (Portrait Narrow Layouts)
   ================================================================= */

/* MAUI mobile width usually between 360–430px */
@media (max-width: 460px) {
    .mahadasha-grid {
        grid-template-columns: repeat(2, 1fr) !important; /* still 2 columns */
        gap: 10px !important;
    }

    .chart-img {
        width: 110px !important;
        max-height: 110px;
        padding: 6px;
    }

    .mahadasha-grid .horo-card {
        padding: 12px !important;
    }
}

/* Ultra-small screens OR MAUI narrow view (older devices) */
@media (max-width: 340px) {
    .mahadasha-grid {
        grid-template-columns: 1fr !important; /* fallback only for ultra small */
        gap: 10px !important;
    }

    .chart-img {
        width: 95px !important;
        max-height: 95px;
    }
}


/*




 =========================================================
   DARK THEME (matches MainLayout system)
   ========================================================= 
:root[data-theme="dark"] {
     Base 
    --bg: #171513;
    --ink: #F4EEE7;
    --muted: #B8ADA3;
     Accent stays same (brand consistency) 
    --accent: #FF8E3C;
    --accent-2: #FFC145;
     Browns tuned for dark 
    --brown-dark: #c7a78c;
    --brown-main: #e1c2a6;
    --brown-soft: #d7b396;
     Surfaces 
    --tan-bg: #2a221c;
    --card-bg: #201d1b;
    --card-soft: #26221f;
    --table-bg: #1e1a17;
     Borders & effects 
    --border: #2b2520;
    --ring: rgba(255,142,60,0.35);
    --shadow: 0 10px 30px rgba(0,0,0,.55);
    --shadow-strong: 0 18px 44px rgba(0,0,0,.65);
}

     =========================================================
   DARK OVERRIDES FOR EXISTING CLASSES (minimal touch)
   ========================================================= 

     Tables 
    :root[data-theme="dark"] .horo-table {
        background: var(--table-bg);
        border-color: var(--border);
    }

        :root[data-theme="dark"] .horo-table th,
        :root[data-theme="dark"] .horo-table td {
            border-color: rgba(255,255,255,0.08);
            color: var(--ink);
        }

        :root[data-theme="dark"] .horo-table thead th {
            background: linear-gradient(180deg, #2a241f, #1f1b18);
            border-bottom: 2px solid rgba(255,142,60,0.35);
        }

         First column highlight 
        :root[data-theme="dark"] .horo-table td:first-child {
            background: #241f1b;
            color: var(--accent-2);
        }

         Zebra rows 
        :root[data-theme="dark"] .horo-table tbody tr:nth-child(odd) {
            background: #1c1815;
        }

         Row hover 
        :root[data-theme="dark"] .horo-table tbody tr:hover {
            background: rgba(255,255,255,0.04);
        }

         Selected row 
        :root[data-theme="dark"] .horo-table tbody tr.is-selected {
            background: rgba(255,142,60,0.18);
        }

     Subtable 
    :root[data-theme="dark"] .horo-subtable {
        background: #1b1815;
    }

        :root[data-theme="dark"] .horo-subtable thead th {
            background: linear-gradient(180deg, #2c241c, #221d18);
        }

     Cards 
    :root[data-theme="dark"] .mahadasha-grid .horo-card {
        background: var(--card-bg);
        border-color: var(--border);
    }

     Chart images block 
    :root[data-theme="dark"] .chart-img {
        background: #1d1a17;
        border-color: var(--border);
    }

     Inputs 
    :root[data-theme="dark"] .horo-card input,
    :root[data-theme="dark"] .horo-card select,
    :root[data-theme="dark"] .horo-card textarea {
        background: #1f1b18;
        color: var(--ink);
        border-color: var(--border);
    }

     Badge pills 
    :root[data-theme="dark"] .badge-pill {
        background: var(--card-soft);
        border-color: var(--border);
        color: var(--ink);
    }

        :root[data-theme="dark"] .badge-pill.is-on {
            background: #2a221c;
        }

     Wrapper consistency 
    :root[data-theme="dark"] .horo-wrapper {
        background: radial-gradient(900px 200px at 10% 0%, rgba(255,142,60,0.08), transparent 60%), radial-gradient(700px 180px at 90% 0%, rgba(255,193,69,0.08), transparent 60%), var(--bg);
    }*/