/* ===== Planet Performance Calculator – page-specific styles =====
   Palette anchored on /guidelines/color/.
   Pills: grade-30 bg + grade-70 border + grade-90 text. Dark flips. */

/* Performance score pill colours */
.perf-excellent { background: #79cd75; border: 1px solid #1d9520; color: #006500; font-weight: 600; } /* Green */
.perf-good      { background: #ffeb99; border: 1px solid #e3a617; color: #8a6534; font-weight: 600; } /* Yellow */
.perf-average   { background: #ffe4a1; border: 1px solid #f67300; color: #db3a00; }                   /* Orange */
.perf-poor      { background: #ff8885; border: 1px solid #da0013; color: #b80000; }                   /* Red */

html.dark .perf-excellent { background: #006500; border-color: #1d9520; color: #79cd75; }
html.dark .perf-good      { background: #8a6534; border-color: #e3a617; color: #ffeb99; }
html.dark .perf-average   { background: #db3a00; border-color: #f67300; color: #ffe4a1; }
html.dark .perf-poor      { background: #b80000; border-color: #da0013; color: #ff8885; }

/* Score chip colours (chart planet entries) — grade-70 light / grade-30 dark */
.score-excellent { color: #1d9520; } /* green-70 */
.score-good      { color: #e3a617; } /* yellow-70 */
.score-average   { color: #f67300; } /* orange-70 */
.score-poor      { color: #da0013; } /* red-70 */

html.dark .score-excellent { color: #79cd75; } /* green-30 */
html.dark .score-good      { color: #ffeb99; } /* yellow-30 */
html.dark .score-average   { color: #ffe4a1; } /* orange-30 */
html.dark .score-poor      { color: #ff8885; } /* red-30 */

/* ===== Glass panels & cards ===== */
.glass-panel {
    background: rgba(255,255,255,.98);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border, #d9d7e0);
}
html.dark .glass-panel {
    background: rgba(30,30,30,.95);
    border-color: #36313d;
}

.stat-card {
    padding: 20px;
    background: #fff;
    border: 1px solid var(--border, #d9d7e0);
    border-radius: 8px;
    transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.04); transform: translateY(-2px); }
html.dark .stat-card { background: #232129; border-color: #36313d; }
html.dark .stat-card:hover { box-shadow: 0 4px 12px rgba(255,255,255,.04); }

.stat-value { font-size: 32px; font-weight: 700; line-height: 1; }
.stat-label { font-size: 12px; color: #635e69; font-weight: 500; text-transform: uppercase; letter-spacing: .5px; margin-top: 8px; }
html.dark .stat-label { color: #b7b5bd; }

/* ===== Data table ===== */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
    background: #f5f5f5;
    color: #232129;
    padding: 10px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #d9d7e0;
    position: sticky; top: 0; z-index: 10;
}
.data-table td { padding: 8px 10px; border-bottom: 1px solid #f0f0f2; }
.data-table tr:hover { background: #fbfbfb; }
html.dark .data-table th { background: #232129; color: #f0f0f2; border-color: #48434f; }
html.dark .data-table td { border-color: #36313d; }
html.dark .data-table tr:hover { background: #36313d; }

/* ===== Tabs ===== */
.tab-button {
    padding: 10px 20px; font-weight: 500;
    border: none;
    border-bottom: 2px solid transparent;
    transition: all .2s; color: #635e69;
    background: none; cursor: pointer;
}
.tab-button:hover { color: #232129; }
.tab-button.active { color: #663399; border-bottom-color: #663399; }
html.dark .tab-button { color: #78757a; }
html.dark .tab-button:hover { color: #fbfbfb; }
html.dark .tab-button.active { color: #d9bae8; border-bottom-color: #d9bae8; }

/* ===== Progress bar ===== */
.progress-bar { width: 100%; height: 24px; background: #f5f5f5; border-radius: 12px; overflow: hidden; }
html.dark .progress-bar { background: #36313d; }
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #663399, #8a4baf);
    transition: width .3s;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 12px; font-weight: 500;
}
html.dark .progress-fill { background: linear-gradient(90deg, #8a4baf, #b17acc); }

/* ===== Dropdown ===== */
.pp-dropdown { display: none; position: absolute; background: #fff; min-width: 200px; box-shadow: 0 8px 16px rgba(0,0,0,.08); z-index: 1000; border: 1px solid #d9d7e0; border-radius: 6px; }
.pp-dropdown.show { display: block; }
html.dark .pp-dropdown { background: #232129; border-color: #48434f; box-shadow: 0 8px 16px rgba(0,0,0,.4); }
.pp-dropdown-item { padding: 8px 12px; cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: 14px; }
.pp-dropdown-item:hover { background: #f5f5f5; }
html.dark .pp-dropdown-item:hover { background: #36313d; }

/* ===== Settings table inputs ===== */
.settings-table input {
    width: 60px; padding: 4px 8px;
    border: 1px solid #d9d7e0;
    border-radius: 4px; text-align: center; font-size: 12px;
    background: transparent; color: inherit;
}
.settings-table input:focus { outline: none; border-color: #b7b5bd; box-shadow: 0 0 0 2px rgba(217, 215, 224, 0.20); }
html.dark .settings-table input { border-color: #48434f; }
html.dark .settings-table input:focus { border-color: #78757a; }

/* ===== Chart container ===== */
.chart-container { position: relative; height: 400px; width: 100%; }

/* ===== South Indian Chart ===== */
.south-chart {
    display: grid;
    grid-template-columns: repeat(4, 100px);
    grid-template-rows: repeat(4, 100px);
    border: 2px solid #36313d;
    width: 400px; height: 400px;
    background: #fbfbfb;
    margin: 20px auto;
}
html.dark .south-chart { border-color: #635e69; background: #232129; }

.chart-cell {
    border: 1px solid #635e69;
    position: relative; font-size: 10px; padding: 4px; overflow: hidden;
    display: flex; flex-direction: column; align-items: flex-start;
}
html.dark .chart-cell { border-color: #635e69; }

.chart-cell.asc { background: #f0f0f2; border: 2px solid #36313d; }
html.dark .chart-cell.asc { background: #36313d; border-color: #78757a; }

.sign-header { font-weight: bold; color: #36313d; font-size: 9px; margin-bottom: 2px; }
html.dark .sign-header { color: #b7b5bd; }

.house-number { position: absolute; top: 2px; right: 4px; font-size: 8px; color: #b7b5bd; }
html.dark .house-number { color: #635e69; }

.planet-entry { color: #000; font-size: 11px; font-weight: 500; line-height: 1.3; }
html.dark .planet-entry { color: #f0f0f2; }

.planet-score { font-size: 9px; font-weight: bold; margin-left: 2px; }

/* ===== Form styling ===== */
.pp-input {
    width: 100%; padding: 8px 12px;
    border: 1px solid var(--border, #d9d7e0);
    border-radius: 6px; font-size: 14px;
    background: #fff; color: #000;
    transition: border-color .2s;
}
.pp-input:focus { outline: none; border-color: #635e69; box-shadow: 0 0 0 2px rgba(217, 215, 224, 0.30); }
html.dark .pp-input { background: #232129; color: #f0f0f2; border-color: #48434f; }
html.dark .pp-input:focus { border-color: #78757a; }

.pp-btn {
    padding: 8px 20px;
    border: 1px solid var(--border, #d9d7e0);
    border-radius: 6px; font-size: 14px; font-weight: 500;
    cursor: pointer; transition: all .2s;
    background: #fff; color: #000;
}
.pp-btn:hover { background: #f5f5f5; }
html.dark .pp-btn { background: #232129; color: #f0f0f2; border-color: #48434f; }
html.dark .pp-btn:hover { background: #36313d; }

.pp-btn-primary {
    background: #663399; color: #fff; border-color: #663399;
}
.pp-btn-primary:hover { background: #542c85; }
html.dark .pp-btn-primary { background: #d9bae8; color: #362066; border-color: #d9bae8; }
html.dark .pp-btn-primary:hover { background: #b17acc; }

/* ===== Location search (matching existing pages) ===== */
.pp-location-wrapper { position: relative; }
.pp-location-dropdown {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; border: 1px solid #d9d7e0; border-radius: 6px;
    max-height: 250px; overflow-y: auto; z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.pp-location-dropdown.active { display: block; }
html.dark .pp-location-dropdown { background: #232129; border-color: #48434f; }
.pp-loc-item { padding: 10px 12px; cursor: pointer; font-size: 13px; border-bottom: 1px solid #f0f0f2; }
.pp-loc-item:hover { background: #f5f5f5; }
.pp-loc-item:last-child { border-bottom: none; }
html.dark .pp-loc-item { border-color: #36313d; }
html.dark .pp-loc-item:hover { background: #36313d; }
.pp-loc-empty { color: #b7b5bd; font-style: italic; }

/* ===== Spinner ===== */
.pp-spinner {
    border: 2px solid #d9d7e0;
    border-top: 2px solid #232129;
    border-radius: 50%; width: 32px; height: 32px;
    animation: pp-spin .8s linear infinite;
}
@keyframes pp-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
html.dark .pp-spinner { border-color: #48434f; border-top-color: #b7b5bd; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .south-chart { grid-template-columns: repeat(4, 80px); grid-template-rows: repeat(4, 80px); width: 320px; height: 320px; }
    .chart-container { height: 300px; }
    .stat-value { font-size: 24px; }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f5f5f5; }
::-webkit-scrollbar-thumb { background: #b7b5bd; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #78757a; }
html.dark ::-webkit-scrollbar-track { background: #232129; }
html.dark ::-webkit-scrollbar-thumb { background: #635e69; }
html.dark ::-webkit-scrollbar-thumb:hover { background: #78757a; }
