/* ===== Planet Performance Calculator – page-specific styles ===== */

/* Performance score pill colours */
.perf-excellent { background: hsl(142 76% 36% / .12); color: hsl(142 76% 36%); font-weight: 600; }
.perf-good      { background: hsl(47 96% 53% / .12);  color: hsl(45 93% 47%);  font-weight: 600; }
.perf-average   { background: hsl(38 92% 50% / .12);  color: hsl(32 95% 44%); }
.perf-poor      { background: hsl(0 84% 60% / .12);   color: hsl(0 84% 60%); }

html.dark .perf-excellent { background: hsl(142 50% 30% / .25); color: hsl(142 76% 60%); }
html.dark .perf-good      { background: hsl(47 60% 40% / .20);  color: hsl(45 93% 65%); }
html.dark .perf-average   { background: hsl(38 50% 40% / .20);  color: hsl(32 95% 60%); }
html.dark .perf-poor      { background: hsl(0 60% 50% / .20);   color: hsl(0 84% 70%); }

/* Score chip colours (for chart planet entries) */
.score-excellent { color: hsl(142 76% 36%); }
.score-good      { color: hsl(45 93% 47%); }
.score-average   { color: hsl(32 95% 44%); }
.score-poor      { color: hsl(0 84% 60%); }

html.dark .score-excellent { color: hsl(142 76% 60%); }
html.dark .score-good      { color: hsl(45 93% 65%); }
html.dark .score-average   { color: hsl(32 95% 60%); }
html.dark .score-poor      { color: hsl(0 84% 70%); }

/* ===== Glass panels & cards ===== */
.glass-panel {
    background: rgba(255,255,255,.98);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border, hsl(0 0% 89.8%));
}
html.dark .glass-panel {
    background: rgba(30,30,30,.95);
    border-color: #333;
}

.stat-card {
    padding: 20px;
    background: #fff;
    border: 1px solid var(--border, hsl(0 0% 89.8%));
    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: #1a1a1a; border-color: #333; }
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: hsl(0 0% 45.1%); font-weight: 500; text-transform: uppercase; letter-spacing: .5px; margin-top: 8px; }
html.dark .stat-label { color: #999; }

/* ===== Data table ===== */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
    background: hsl(0 0% 96.1%);
    color: hsl(0 0% 9%);
    padding: 10px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid hsl(0 0% 89.8%);
    position: sticky; top: 0; z-index: 10;
}
.data-table td { padding: 8px 10px; border-bottom: 1px solid hsl(0 0% 94%); }
.data-table tr:hover { background: hsl(0 0% 98%); }
html.dark .data-table th { background: #222; color: #eee; border-color: #444; }
html.dark .data-table td { border-color: #333; }
html.dark .data-table tr:hover { background: #2a2a2a; }

/* ===== Tabs ===== */
.tab-button {
    padding: 10px 20px; font-weight: 500;
    border: none;
    border-bottom: 2px solid transparent;
    transition: all .2s; color: hsl(0 0% 45.1%);
    background: none; cursor: pointer;
}
.tab-button:hover { color: hsl(0 0% 9%); }
.tab-button.active { color: hsl(0 0% 9%); border-bottom-color: hsl(0 0% 9%); }
html.dark .tab-button { color: #888; }
html.dark .tab-button:hover { color: #eee; }
html.dark .tab-button.active { color: #fff; border-bottom-color: #fff; }

/* ===== Progress bar ===== */
.progress-bar { width: 100%; height: 24px; background: hsl(0 0% 96.1%); border-radius: 12px; overflow: hidden; }
html.dark .progress-bar { background: #333; }
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, hsl(0 0% 9%), hsl(0 0% 30%));
    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, #666, #999); }

/* ===== 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 hsl(0 0% 89.8%); border-radius: 6px; }
.pp-dropdown.show { display: block; }
html.dark .pp-dropdown { background: #1e1e1e; border-color: #444; 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: hsl(0 0% 96.1%); }
html.dark .pp-dropdown-item:hover { background: #2a2a2a; }

/* ===== Settings table inputs ===== */
.settings-table input {
    width: 60px; padding: 4px 8px;
    border: 1px solid hsl(0 0% 89.8%);
    border-radius: 4px; text-align: center; font-size: 12px;
    background: transparent; color: inherit;
}
.settings-table input:focus { outline: none; border-color: hsl(0 0% 70%); box-shadow: 0 0 0 2px hsl(0 0% 89.8% / .2); }
html.dark .settings-table input { border-color: #444; }
html.dark .settings-table input:focus { border-color: #888; }

/* ===== 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 #333;
    width: 400px; height: 400px;
    background: #fafafa;
    margin: 20px auto;
}
html.dark .south-chart { border-color: #666; background: #1a1a1a; }

.chart-cell {
    border: 1px solid #666;
    position: relative; font-size: 10px; padding: 4px; overflow: hidden;
    display: flex; flex-direction: column; align-items: flex-start;
}
html.dark .chart-cell { border-color: #555; }

.chart-cell.asc { background: #f0f0f0; border: 2px solid #333; }
html.dark .chart-cell.asc { background: #2a2a2a; border-color: #888; }

.sign-header { font-weight: bold; color: #333; font-size: 9px; margin-bottom: 2px; }
html.dark .sign-header { color: #ccc; }

.house-number { position: absolute; top: 2px; right: 4px; font-size: 8px; color: #999; }
html.dark .house-number { color: #666; }

.planet-entry { color: #000; font-size: 11px; font-weight: 500; line-height: 1.3; }
html.dark .planet-entry { color: #eee; }

.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, hsl(0 0% 89.8%));
    border-radius: 6px; font-size: 14px;
    background: #fff; color: #000;
    transition: border-color .2s;
}
.pp-input:focus { outline: none; border-color: #666; box-shadow: 0 0 0 2px hsl(0 0% 89.8% / .3); }
html.dark .pp-input { background: #1a1a1a; color: #eee; border-color: #444; }
html.dark .pp-input:focus { border-color: #888; }

.pp-btn {
    padding: 8px 20px;
    border: 1px solid var(--border, hsl(0 0% 89.8%));
    border-radius: 6px; font-size: 14px; font-weight: 500;
    cursor: pointer; transition: all .2s;
    background: #fff; color: #000;
}
.pp-btn:hover { background: hsl(0 0% 96.1%); }
html.dark .pp-btn { background: #1a1a1a; color: #eee; border-color: #444; }
html.dark .pp-btn:hover { background: #2a2a2a; }

.pp-btn-primary {
    background: hsl(0 0% 9%); color: #fff; border-color: hsl(0 0% 9%);
}
.pp-btn-primary:hover { background: hsl(0 0% 20%); }
html.dark .pp-btn-primary { background: #ddd; color: #000; border-color: #ddd; }
html.dark .pp-btn-primary:hover { background: #fff; }

/* ===== 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 #ddd; 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: #1e1e1e; border-color: #444; }
.pp-loc-item { padding: 10px 12px; cursor: pointer; font-size: 13px; border-bottom: 1px solid #eee; }
.pp-loc-item:hover { background: #f5f5f5; }
.pp-loc-item:last-child { border-bottom: none; }
html.dark .pp-loc-item { border-color: #333; }
html.dark .pp-loc-item:hover { background: #2a2a2a; }
.pp-loc-empty { color: #999; font-style: italic; }

/* ===== Spinner ===== */
.pp-spinner {
    border: 2px solid hsl(0 0% 89.8%);
    border-top: 2px solid hsl(0 0% 9%);
    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: #444; border-top-color: #ccc; }

/* ===== 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: hsl(0 0% 96.1%); }
::-webkit-scrollbar-thumb { background: hsl(0 0% 70%); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: hsl(0 0% 60%); }
html.dark ::-webkit-scrollbar-track { background: #1a1a1a; }
html.dark ::-webkit-scrollbar-thumb { background: #555; }
html.dark ::-webkit-scrollbar-thumb:hover { background: #777; }
