/* ===== Modern Clean Theme (Apple/Notion) ===== */
:root {
    /* Gray Scale Palette */
    --color-bg: #F9FAFB;
    /* Gray 50 */
    --color-surface: #FFFFFF;
    /* White */
    --color-border: #E5E7EB;
    /* Gray 200 */
    --color-text: #111827;
    /* Gray 900 */
    --color-text-muted: #6B7280;
    /* Gray 500 */

    /* Decoration */
    --color-primary: #111827;
    /* Black Action */
    --color-primary-hover: #374151;
    --color-accent: #3B82F6;
    /* Blue Focus/Links */
    --color-input-bg: #F9FAFB;
    /* Gray 50 */

    /* Functional */
    --color-success: #10B981;
    /* Emerald */
    --color-error: #EF4444;
    /* Red */

    /* Channel Badges */
    --badge-offline: #E0F2FE;
    --text-offline: #0369A1;
    --badge-grab: #DCFCE7;
    --text-grab: #15803D;
    --badge-shopee: #FFEDD5;
    --text-shopee: #C2410C;

    /* Spacing & Radius */
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    padding: 24px;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

button {
    font-family: inherit;
    border: none;
    cursor: pointer;
}

/* ===== App Container ===== */
.app-container {
    max-width: 640px;
    margin: 0 auto;
    padding-bottom: 60px;
}

/* Header */
.app-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-top: 1rem;
}

.app-header h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

/* ===== Cards & Sections ===== */
.input-section,
.results-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2,
.results-section h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
}

/* ===== Inputs ===== */
.input-group {
    margin-bottom: 1.25rem;
}

.input-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: var(--color-input-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: all 0.2s ease;
}

.input-wrapper:focus-within {
    background: var(--color-surface);
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-wrapper input {
    width: 100%;
    border: none;
    background: transparent;
    padding: 10px 12px;
    font-size: 1rem;
    color: var(--color-text);
    outline: none;
}

.input-wrapper .unit {
    padding: 0 12px;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    border-left: 1px solid var(--color-border);
    background: var(--color-surface);
    height: 100%;
    display: flex;
    align-items: center;
}

/* Toggle & Mode Switch */
.toggle-btn {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-accent);
    background: transparent;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.toggle-btn:hover {
    background: #EFF6FF;
}

.mode-switch {
    display: flex;
    background: var(--color-input-bg);
    padding: 4px;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
}

.mode-btn {
    flex: 1;
    padding: 6px 12px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-muted);
    border-radius: 6px;
    transition: all 0.2s;
}

.mode-btn.active {
    background: var(--color-surface);
    color: var(--color-text);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* ===== Channel Cards ===== */
.channels-grid {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .channels-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.channel-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    transition: all 0.2s ease;
}

.channel-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.channel-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    font-weight: 600;
}

/* Channel Badges */
.channel-icon {
    display: none;
    /* Hide emoji for cleaner look or modify */
}

.channel-name {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.channel-card.offline .channel-name {
    background: var(--badge-offline);
    color: var(--text-offline);
}

.channel-card.grab .channel-name {
    background: var(--badge-grab);
    color: var(--text-grab);
}

.channel-card.shopee .channel-name {
    background: var(--badge-shopee);
    color: var(--text-shopee);
}

/* Prices */
.channel-result {
    text-align: center;
    margin: 1.5rem 0;
}

.selling-price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.025em;
}

.rounding-info {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 4px;
}

/* Details */
.channel-details {
    padding-top: 1rem;
    border-top: 1px dashed var(--color-border);
}

.details-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.detail-item span:last-child {
    color: var(--color-text);
    font-weight: 500;
}

.detail-item.profit {
    color: var(--color-success);
    font-weight: 600;
}

.detail-item.profit span:last-child {
    color: var(--color-success);
}

/* Action Buttons */
.reset-btn {
    width: 100%;
    margin-top: 1rem;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-error);
    font-weight: 500;
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.reset-btn:hover {
    background: #FEF2F2;
    border-color: #FCA5A5;
}

/* Helper Utilities */
.hidden {
    display: none !important;
}

.unit-section,
.settings-grid {
    margin-top: 1rem;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}