/* Jyotish Advanced - Professional Vedic Astrology CSS */
:root {
    --saffron: #FF6B00;
    --maroon: #800020;
    --gold: #DAA520;
    --cream: #FFF8DC;
    --light-cream: #FFFAF0;
    --dark: #333;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: linear-gradient(135deg, #FFF5E6 0%, #FFE4C4 100%);
    min-height: 100vh;
    color: var(--dark);
}

/* Header */
.chart-header {
    background: linear-gradient(135deg, var(--maroon), #600018);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.chart-header h1 { font-size: 1.8rem; }
.birth-info { display: flex; gap: 20px; margin-top: 8px; font-size: 0.9rem; opacity: 0.9; }
.edit-btn {
    background: var(--gold);
    color: var(--maroon);
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}
.edit-btn:hover { background: white; transform: scale(1.05); }

.header-buttons {
    display: flex;
    gap: 10px;
}
.header-buttons .btn-text {
    display: inline;
}
.export-btn {
    background: #2e7d32;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}
.export-btn:hover { background: #1b5e20; transform: scale(1.05); }
.export-btn:disabled { background: #888; cursor: not-allowed; transform: none; }

.save-databank-btn {
    background: linear-gradient(135deg, #9c27b0, #7b1fa2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}
.save-databank-btn:hover { background: linear-gradient(135deg, #7b1fa2, #6a1b9a); transform: scale(1.05); }
.save-databank-btn:disabled { background: #888; cursor: not-allowed; transform: none; }

.ask-ai-btn {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 3px 10px rgba(255, 107, 53, 0.3);
}
.ask-ai-btn:hover { background: linear-gradient(135deg, #f7931e, #ff6b35); transform: scale(1.05); box-shadow: 0 5px 15px rgba(255, 107, 53, 0.4); }
.ask-ai-btn:disabled { background: #888; cursor: not-allowed; transform: none; box-shadow: none; }

/* Tabs */
.tabs {
    display: flex;
    background: white;
    padding: 0 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow-x: auto;
}
.tab {
    padding: 15px 25px;
    border: none;
    background: none;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    white-space: nowrap;
}
.tab:hover { color: var(--maroon); }
.tab.active { color: var(--maroon); border-bottom-color: var(--saffron); }

/* Tab Content - Optimized for performance */
.tab-content {
    display: none;
    padding: 20px;
    contain: layout style;  /* Limit layout recalculations */
}
.tab-content.active {
    display: block;
    /* Removed content-visibility: auto - it was preventing charts from rendering on page load */
}

/* Dasha hierarchy performance optimization */
.dasha-children {
    contain: content;  /* Isolate layout/paint */
}
.dasha-section {
    contain: layout style;
}

/* Selector Wheel */
.selector-wheel {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: white;
    border-radius: 50px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    overflow-x: auto;
    justify-content: center;
}
.wheel-btn {
    padding: 10px 20px;
    border: 2px solid var(--gold);
    background: white;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    color: var(--maroon);
    transition: all 0.3s;
    white-space: nowrap;
}
.wheel-btn:hover { background: var(--cream); }
.wheel-btn.active { background: var(--gold); color: white; }

/* KCD Options */
.kcd-options {
    display: flex;
    gap: 15px;
    align-items: center;
    padding: 10px 20px;
    background: #f5f5f5;
    border-radius: 10px;
    margin-bottom: 20px;
}
.kcd-options label { font-weight: 600; color: #666; }
.kcd-options select {
    padding: 8px 15px;
    border: 2px solid var(--gold);
    border-radius: 5px;
    background: white;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
}
.card h3 {
    color: var(--maroon);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--cream);
}

/* Grid Layouts */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 15px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }

/* Chart Container */
.chart-container { width: 100%; max-width: 400px; margin: 0 auto; }

/* Data Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.data-table th, .data-table td {
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid #eee;
}
.data-table th {
    background: var(--cream);
    color: var(--maroon);
    font-weight: 600;
}
.data-table tr:hover { background: #fafafa; }

.mini-table { font-size: 0.85rem; }
.mini-table th, .mini-table td { padding: 6px 8px; }

/* Planet Colors */
.planet-sun { color: #FF6B00; font-weight: 600; }
.planet-moon { color: #4169E1; font-weight: 600; }
.planet-mars { color: #DC143C; font-weight: 600; }
.planet-mercury { color: #228B22; font-weight: 600; }
.planet-jupiter { color: #FFD700; font-weight: 600; }
.planet-venus { color: #FF69B4; font-weight: 600; }
.planet-saturn { color: #4B0082; font-weight: 600; }
.planet-rahu { color: #708090; font-weight: 600; }
.planet-ketu { color: #8B4513; font-weight: 600; }

/* Dasha Cards */
.dasha-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}
.md-card {
    background: linear-gradient(135deg, var(--cream), white);
    border: 2px solid var(--gold);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
}
.md-card:hover { box-shadow: 0 5px 20px rgba(218,165,32,0.3); transform: translateY(-2px); }
.md-card.yogini { border-color: #9370DB; background: linear-gradient(135deg, #f3e5f5, white); }
.md-card.kalachakra { border-color: #4CAF50; background: linear-gradient(135deg, #e8f5e9, white); }
.md-card.chara { border-color: #FF9800; background: linear-gradient(135deg, #fff3e0, white); }

.md-header-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(255,255,255,0.5);
}
.md-name { font-weight: 700; color: var(--maroon); font-size: 1.1rem; }
.md-dates { color: #666; font-size: 0.85rem; }
.md-yrs { background: var(--gold); color: white; padding: 3px 10px; border-radius: 15px; font-size: 0.8rem; }

.ad-table { padding: 10px; background: white; }

/* Dasha Hierarchy - 5 Level Expandable */
.dasha-hierarchy { max-height: 600px; overflow-y: auto; }
.dasha-level { border-left: 3px solid transparent; margin-bottom: 2px; }
.dasha-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.2s;
    border-radius: 5px;
}
.dasha-header:hover { background: rgba(218,165,32,0.1); }
.expand-icon { color: var(--gold); font-size: 0.8rem; width: 15px; }
.dasha-planet { font-weight: 600; color: var(--maroon); flex: 1; }
.dasha-period { color: #666; font-size: 0.85rem; }
.dasha-duration { background: var(--gold); color: white; padding: 2px 8px; border-radius: 10px; font-size: 0.75rem; }
.dasha-children { padding-left: 20px; border-left: 2px solid #eee; margin-left: 7px; }

/* MD Level */
.md-level { background: linear-gradient(135deg, #fff8dc, white); border-left-color: var(--gold); border-radius: 8px; margin-bottom: 8px; }
.md-level > .dasha-header { background: rgba(218,165,32,0.15); border-radius: 8px 8px 0 0; }
.md-level.yogini { border-left-color: #9370DB; background: linear-gradient(135deg, #f3e5f5, white); }
.md-level.yogini > .dasha-header { background: rgba(147,112,219,0.15); }
.md-level.kalachakra-md { border-left-color: #4CAF50; background: linear-gradient(135deg, #e8f5e9, white); }
.md-level.kalachakra-md > .dasha-header { background: rgba(76,175,80,0.15); }
.md-level.chara-md { border-left-color: #FF9800; background: linear-gradient(135deg, #fff3e0, white); }
.md-level.chara-md > .dasha-header { background: rgba(255,152,0,0.15); }

/* AD Level */
.ad-level { background: rgba(255,255,255,0.8); border-left-color: #ff9800; border-radius: 5px; }
.ad-level > .dasha-header:hover { background: rgba(255,152,0,0.1); }

/* PD Level */
.pd-level { background: rgba(255,255,255,0.6); border-left-color: #2196f3; border-radius: 4px; }
.pd-level > .dasha-header:hover { background: rgba(33,150,243,0.1); }
.pd-level > .dasha-header { padding: 8px 12px; }
.pd-level .dasha-planet { font-size: 0.9rem; }

/* SD Level */
.sd-level { background: rgba(255,255,255,0.4); border-left-color: #4caf50; border-radius: 3px; }
.sd-level > .dasha-header:hover { background: rgba(76,175,80,0.1); }
.sd-level > .dasha-header { padding: 6px 10px; }
.sd-level .dasha-planet { font-size: 0.85rem; font-weight: 500; }
.sd-level .dasha-period { font-size: 0.75rem; }

/* Prana Level (deepest) */
.prana-level { background: rgba(156,39,176,0.05); border-left-color: #9c27b0; border-radius: 2px; }
.prana-header { padding: 4px 8px !important; cursor: default; }
.prana-header:hover { background: rgba(156,39,176,0.1) !important; }
.prana-level .dasha-planet { font-size: 0.8rem; font-weight: 400; color: #666; }
.prana-level .dasha-period { font-size: 0.7rem; color: #888; }

/* Bar Charts */
.bar-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}
.bar-charts-grid.houses { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); }

.planet-bar-card, .house-bar-card {
    background: white;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #eee;
}
.planet-bar-name, .house-bar-name {
    font-weight: 700;
    color: var(--maroon);
    margin-bottom: 8px;
}
.bar-container {
    height: 25px;
    background: #eee;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}
.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--maroon), var(--saffron));
    border-radius: 12px;
    transition: width 0.5s;
}
.bar-fill.house-bar { background: linear-gradient(90deg, #4CAF50, #8BC34A); }
.bar-label {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    font-weight: 600;
    color: #333;
}

/* Strength Colors */
.strength-good { color: #228B22; font-weight: 700; }
.strength-weak { color: #DC143C; font-weight: 700; }

/* Ashtakavarga */
.ashtaka-table td { text-align: center; width: 40px; }
.av-high { background: #c8e6c9; color: #2e7d32; font-weight: 600; }
.av-mid { background: #fff9c4; color: #f57f17; }
.av-low { background: #ffcdd2; color: #c62828; font-weight: 600; }
.sarva-row { background: var(--cream); }

/* Special Degrees */
.danger { color: #DC143C; font-weight: 700; }
.safe { color: #228B22; }
.blessed { color: var(--gold); font-weight: 700; }
.normal { color: #666; }
.info-text { color: #666; font-style: italic; margin-bottom: 15px; }

/* Arudha Grid */
.arudha-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: 8px;
}
.arudha-item {
    background: var(--cream);
    padding: 8px;
    border-radius: 8px;
    text-align: center;
    font-size: 0.85rem;
    border: 1px solid var(--gold);
}

/* Mini Cards */
.mini-card {
    background: var(--light-cream);
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #ddd;
}
.mini-card strong { color: var(--maroon); }

/* Panchanga Row */
.panchanga-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}
.panch-item {
    flex: 1;
    min-width: 150px;
    background: var(--cream);
    padding: 12px;
    border-radius: 8px;
    text-align: center;
}
.panch-label { display: block; font-size: 0.8rem; color: #666; margin-bottom: 5px; }
.panch-val { font-weight: 700; color: var(--maroon); }

/* Panchanga Sections - Birth vs Today */
.panchanga-section {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 10px;
    background: #fafafa;
}
.panchanga-section:last-child { margin-bottom: 0; }
.panchanga-title, .panchanga-subtitle {
    margin: 0 0 12px 0;
    font-size: 1rem;
    color: var(--maroon);
    display: flex;
    align-items: center;
    gap: 8px;
}
.panchanga-title small, .panchanga-subtitle small {
    color: #888;
    font-weight: normal;
    font-size: 0.85rem;
}
.today-panchanga {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border: 2px solid #81c784;
}
.today-panchanga .panchanga-title,
.today-panchanga .panchanga-subtitle {
    color: #2e7d32;
}
.today-panchanga .panch-val {
    color: #2e7d32;
}

/* Panchanga Location Editor */
.panchanga-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.refresh-panchanga-btn {
    background: transparent;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s, transform 0.3s;
}
.refresh-panchanga-btn:hover {
    opacity: 1;
    transform: rotate(180deg);
}
.location-editor {
    margin-top: 15px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 10px;
    border: 2px dashed #ccc;
}
.location-inputs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.location-inputs input {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    width: 100px;
    font-size: 0.9rem;
}
.location-inputs input:focus {
    border-color: var(--gold);
    outline: none;
}
.location-inputs button {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}
.location-inputs button:first-of-type {
    background: var(--maroon);
    color: white;
}
.location-inputs button:last-of-type {
    background: #e0e0e0;
    color: #333;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}
.modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    position: relative;
}
.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    cursor: pointer;
    color: #666;
}
.close:hover { color: var(--maroon); }

/* Form Styles */
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 600; color: #555; }
.form-group input, .form-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}
.form-group input:focus { border-color: var(--gold); outline: none; }
.form-row { display: flex; gap: 15px; }
.form-row .form-group { flex: 1; }

.submit-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--maroon), #600018);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
}
.submit-btn:hover { opacity: 0.9; }

/* Home Page */
.home-container {
    max-width: 500px;
    margin: 50px auto;
    padding: 20px;
}
.home-container h1 {
    text-align: center;
    color: var(--maroon);
    font-size: 2.5rem;
    margin-bottom: 10px;
}
.form-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.1);
}

/* Autocomplete */
.autocomplete-container { position: relative; }
.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid var(--gold);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}
.autocomplete-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}
.autocomplete-item:hover { background: var(--cream); }

/* Karaka */
.karaka { color: var(--maroon); font-weight: 600; font-size: 0.85rem; }

/* Responsive */
@media (max-width: 768px) {
    .chart-header { flex-direction: column; gap: 15px; text-align: center; padding: 15px; }
    .chart-header h1 { font-size: 1.4rem; }
    .birth-info { flex-direction: column; gap: 5px; font-size: 0.85rem; }
    .header-buttons {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
        gap: 8px;
    }
    .header-buttons button, .header-buttons .edit-btn, .header-buttons .ask-ai-btn,
    .header-buttons .save-databank-btn, .header-buttons .export-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
        flex: 1 1 45%;
        max-width: 48%;
        min-width: 120px;
    }

    .grid-2 { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr 1fr; }
    .grid-4 { grid-template-columns: 1fr 1fr; }

    .tabs { justify-content: flex-start; padding: 0 10px; }
    .tab { padding: 12px 15px; font-size: 0.85rem; }

    .selector-wheel { justify-content: flex-start; padding: 10px; gap: 8px; }
    .wheel-btn { padding: 8px 15px; font-size: 0.85rem; }

    .tab-content { padding: 15px; }
    .card { padding: 15px; margin-bottom: 15px; }
    .card h3 { font-size: 1rem; }

    .data-table { font-size: 0.8rem; }
    .data-table th, .data-table td { padding: 8px 6px; }

    .dasha-grid { grid-template-columns: 1fr; }
    .bar-charts-grid { grid-template-columns: 1fr 1fr; }
    .bar-charts-grid.houses { grid-template-columns: repeat(4, 1fr); }

    .panchanga-row { flex-direction: column; }
    .panch-item { min-width: 100%; }

    .form-row { flex-direction: column; gap: 10px; }
    .home-container { margin: 20px 15px; padding: 15px; }
    .home-container h1 { font-size: 2rem; }
    .form-card { padding: 20px; }

    .modal-content { margin: 10% 15px; padding: 20px; max-width: none; }

    .kcd-panel { flex-direction: column; align-items: stretch; }
    .kcd-option { justify-content: space-between; }
    .kcd-apply { margin-left: 0; margin-top: 10px; width: 100%; }

    .main-nav { flex-direction: column; gap: 15px; padding: 15px; text-align: center; }
    .nav-links { flex-wrap: wrap; justify-content: center; gap: 10px; }
    .nav-links a { padding: 6px 12px; font-size: 0.9rem; }

    .chart-container { max-width: 100%; }
}

@media (max-width: 480px) {
    .chart-header { padding: 12px 10px; }
    .chart-header h1 { font-size: 1.1rem; }
    .birth-info { font-size: 0.75rem; gap: 3px; }
    .birth-info span { display: block; }
    .header-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        width: 100%;
    }
    .header-buttons button, .header-buttons .edit-btn,
    .header-buttons .save-databank-btn, .header-buttons .export-btn,
    .header-buttons .ask-ai-btn {
        padding: 10px 8px;
        font-size: 0.7rem;
        border-radius: 8px;
        min-width: unset;
        max-width: unset;
        flex: unset;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    .tabs::-webkit-scrollbar { display: none; }
    .tab { padding: 10px 12px; font-size: 0.8rem; }

    .grid-2 { grid-template-columns: 1fr; gap: 10px; }
    .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .bar-charts-grid { grid-template-columns: 1fr; }
    .bar-charts-grid.houses { grid-template-columns: repeat(3, 1fr); }

    .card { padding: 12px; margin-bottom: 10px; border-radius: 10px; }
    .card h3 { font-size: 0.9rem; margin-bottom: 10px; }

    .chart-container { max-width: 100%; padding: 0; }

    .data-table { font-size: 0.7rem; display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .data-table th, .data-table td { padding: 5px 3px; white-space: nowrap; }
    .data-table th { font-size: 0.65rem; }

    .selector-wheel { padding: 8px; border-radius: 20px; gap: 5px; justify-content: flex-start; }
    .wheel-btn { padding: 6px 10px; font-size: 0.75rem; }

    .planetRow { flex-direction: column; gap: 5px; }

    .dasha-header { padding: 8px 10px; gap: 5px; }
    .dasha-planet { font-size: 0.85rem; }
    .dasha-period { font-size: 0.75rem; }
    .dasha-duration { font-size: 0.7rem; padding: 2px 6px; }
    .dasha-children { padding-left: 12px; }

    .arudha-grid { grid-template-columns: repeat(4, 1fr); gap: 5px; }
    .arudha-item { padding: 6px; font-size: 0.75rem; }

    .selector-wheel { border-radius: 25px; padding: 8px; }
    .wheel-btn { padding: 6px 12px; font-size: 0.8rem; }

    .home-container h1 { font-size: 1.6rem; }
    .form-group input, .form-group select { padding: 8px; font-size: 0.9rem; }
    .submit-btn { padding: 10px; font-size: 0.9rem; }

    .section-note { padding: 10px 12px; font-size: 0.85em; }

    .nav-brand { font-size: 1.2rem; }
    .nav-links a { padding: 5px 10px; font-size: 0.85rem; }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .tab, .wheel-btn, button, .edit-btn, .ask-ai-btn, .export-btn {
        min-height: 44px;
        min-width: 44px;
    }
    .dasha-header { min-height: 48px; }
    .autocomplete-item { min-height: 44px; display: flex; align-items: center; }
}

/* KCD Options Panel */
.kcd-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border-radius: 10px;
    margin-bottom: 20px;
    border: 2px solid #4CAF50;
}
.kcd-option {
    display: flex;
    align-items: center;
    gap: 8px;
}
.kcd-option label {
    font-weight: 600;
    color: #2e7d32;
    white-space: nowrap;
}
.kcd-option select {
    padding: 8px 12px;
    border: 2px solid #4CAF50;
    border-radius: 5px;
    background: white;
    font-size: 0.9rem;
}
.kcd-apply {
    padding: 10px 20px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    margin-left: auto;
}
.kcd-apply:hover {
    background: #388E3C;
}

/* Direction badge */
.direction {
    font-size: 0.75rem;
    color: #666;
    font-weight: normal;
}


/* Section Notes */
.section-note {
    margin-top: 15px;
    padding: 12px 15px;
    background: linear-gradient(135deg, #FFF8E1, #FFF3E0);
    border-left: 4px solid var(--gold);
    border-radius: 0 8px 8px 0;
    font-size: 0.9em;
    color: #5D4037;
}
.section-note strong {
    color: var(--maroon);
}


/* Main Navigation */
.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: var(--maroon);
    color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--gold);
    text-decoration: none;
}
.nav-links {
    display: flex;
    gap: 25px;
}
.nav-links a {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 20px;
    transition: background 0.3s;
}
.nav-links a:hover {
    background: rgba(255,255,255,0.15);
}


/* ==================== SARVATOBHADRA CHAKRA ==================== */
.sbc-info {
    margin-bottom: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #FFF8E1, #FFF3E0);
    border-radius: 10px;
    border-left: 4px solid var(--gold);
}
.sbc-info p {
    margin: 8px 0;
}
.sbc-janma {
    color: #2E7D32;
    font-weight: bold;
    background: #E8F5E9;
    padding: 2px 8px;
    border-radius: 4px;
}
.sbc-vedha-tag {
    display: inline-block;
    background: #FFEBEE;
    color: #C62828;
    padding: 2px 8px;
    border-radius: 4px;
    margin: 2px;
    font-size: 0.9em;
}

.sbc-grid-container {
    overflow-x: auto;
    margin: 20px 0;
}

.sbc-grid {
    border-collapse: collapse;
    margin: 0 auto;
    font-size: 0.85em;
}
.sbc-cell {
    width: 50px;
    height: 50px;
    text-align: center;
    vertical-align: middle;
    border: 1px solid #DDD;
    padding: 4px;
    transition: all 0.3s;
}
.sbc-text {
    display: block;
    font-size: 0.9em;
}

/* Cell types */
.sbc-nakshatra {
    background: #FFF8E1;
    color: #5D4037;
    font-weight: 500;
}
.sbc-rashi {
    background: #E3F2FD;
    color: #1565C0;
    font-weight: bold;
    font-size: 1.2em;
}
.sbc-vara {
    background: #F3E5F5;
    color: #7B1FA2;
}
.sbc-swara {
    background: #FFFDE7;
    color: #F57F17;
}
.sbc-vyanjana {
    background: #E8F5E9;
    color: #2E7D32;
}
.sbc-center {
    background: var(--maroon);
    color: var(--gold);
    font-size: 1.5em;
}

/* Highlights */
.sbc-highlight-janma {
    background: #4CAF50 !important;
    color: white !important;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
    animation: pulse-green 2s infinite;
}
.sbc-highlight-vedha {
    background: #EF5350 !important;
    color: white !important;
    box-shadow: 0 0 8px rgba(239, 83, 80, 0.4);
}
.sbc-highlight-vara {
    background: #7E57C2 !important;
    color: white !important;
}

@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 5px rgba(76, 175, 80, 0.5); }
    50% { box-shadow: 0 0 15px rgba(76, 175, 80, 0.8); }
}

/* Legend */
.sbc-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
    flex-wrap: wrap;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
}
.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}
.legend-color.sbc-highlight-janma {
    background: #4CAF50;
}
.legend-color.sbc-highlight-vedha {
    background: #EF5350;
}
.legend-color.sbc-highlight-vara {
    background: #7E57C2;
}

/* Responsive */
@media (max-width: 600px) {
    .sbc-cell {
        width: 35px;
        height: 35px;
        font-size: 0.7em;
    }
    .sbc-text {
        font-size: 0.8em;
    }
}
