/* DeltaCalc - Dark Theme Styles */
/* Mobile-first, responsive */

/* ── Reset & Base ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg-primary: #0f0f1a;
    --bg-card: #1a1a2e;
    --bg-card-hover: #1f1f35;
    --text-primary: #e8e8f0;
    --text-secondary: #a0a0b8;
    --text-muted: #6a6a80;
    --gold: #f0c040;
    --gold-dim: #8a7030;
    --purple: #a078d0;
    --green: #4caf84;
    --red: #e05555;
    --border: #2a2a3a;
    --radius: 12px;
    --shadow: 0 4px 24px rgba(0,0,0,0.3);
}

html { font-size: 16px; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
}

/* ── Layout ───────────────────────────────────── */
#app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
}

header {
    text-align: center;
    padding: 24px 0 16px;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

header .subtitle {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 4px;
}

/* ── Slot Grid ────────────────────────────────── */
.slot-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 16px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Mobile: tighter spacing and smaller type for narrow screens */
@media (max-width: 400px) {
    .slot-grid {
        gap: 8px;
    }
}

/* ── Card ─────────────────────────────────────── */
.slot-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: transform 0.15s, box-shadow 0.15s;
}

@media (max-width: 400px) {
    .slot-card {
        padding: 12px;
    }
}

.slot-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 32px rgba(0,0,0,0.4);
}

.slot-card .slot-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.slot-card .slot-icon { font-size: 1.5rem; }

.slot-card .slot-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

@media (max-width: 400px) {
    .slot-card .slot-name { font-size: 0.9rem; }
}

/* ── Item Content ─────────────────────────────── */
.slot-card .item-image {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    object-fit: contain;
    background: rgba(255,255,255,0.05);
    margin: 0 auto 12px;
    display: block;
}

.slot-card .item-image-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--text-muted);
}

.slot-card .item-name {
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 12px;
    color: var(--text-primary);
    min-height: 1.4em;
}

/* ── Profit Display ───────────────────────────── */
.slot-card .profit-main {
    text-align: center;
    margin-bottom: 12px;
}

.slot-card .profit-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--gold);
    line-height: 1.2;
}

@media (max-width: 400px) {
    .slot-card .profit-value { font-size: 1.3rem; }
}

.slot-card .profit-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ── Detail Rows ──────────────────────────────── */
.slot-card .detail-rows {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.slot-card .detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
}

@media (max-width: 400px) {
    .slot-card .detail-row { font-size: 0.72rem; }
}

.slot-card .detail-row .label { color: var(--text-secondary); }
.slot-card .detail-row .value { color: var(--text-primary); font-weight: 500; }

/* ── Star Rating ──────────────────────────────── */
.stars {
    text-align: center;
    margin-bottom: 8px;
}

.stars .star {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin: 0 1px;
    font-size: 14px;
    color: var(--gold-dim);
}

.stars .star.filled { color: var(--gold); }

/* ── Status Bar ───────────────────────────────── */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    margin-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.status-bar .refresh-btn {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 14px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.15s;
}

.status-bar .refresh-btn:hover { background: var(--bg-card-hover); }
.status-bar .refresh-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Skeleton Loading ─────────────────────────── */
.skeleton {
    animation: shimmer 1.5s ease-in-out infinite;
    background: linear-gradient(90deg, var(--bg-card) 25%, #252540 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-image {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    margin: 0 auto 12px;
}

.skeleton-text {
    height: 1em;
    border-radius: 4px;
    margin-bottom: 8px;
}

.skeleton-text.short { width: 60%; margin-left: auto; margin-right: auto; }
.skeleton-text.medium { width: 80%; }
.skeleton-value {
    height: 2rem;
    width: 50%;
    border-radius: 4px;
    margin: 12px auto;
}

/* ── Error State ──────────────────────────────── */
.error-banner {
    background: rgba(224, 85, 85, 0.15);
    border: 1px solid var(--red);
    border-radius: var(--radius);
    padding: 12px 16px;
    color: var(--red);
    font-size: 0.85rem;
    text-align: center;
    margin-bottom: 16px;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 24px 0;
    font-size: 0.9rem;
}
