/* Premium iOS/Flagship Theme */
:root {
    --bg-color: #f5f5f7;
    --card-bg: #ffffff;
    --text-main: #1d1d1f;
    --text-muted: #86868b;
    --primary: #0071e3;
    --primary-hover: #0077ed;
    --danger: #ff3b30;
    --border: rgba(0, 0, 0, 0.08);
    --input-bg: #f5f5f7;
    --radius-card: 20px;
    --radius-btn: 14px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}

body.dark-mode {
    --bg-color: #000000;
    --card-bg: #1c1c1e;
    --text-main: #f5f5f7;
    --text-muted: #98989d;
    --primary: #0a84ff;
    --primary-hover: #409cff;
    --border: rgba(255, 255, 255, 0.12);
    --input-bg: #2c2c2e;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    padding-bottom: 3rem;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container { max-width: 700px; margin: 0 auto; padding: 0 1rem; }

/* Header & Toggle */
header {
    padding: 2rem 0 1.5rem;
    margin-bottom: 1rem;
}
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
header h1 { font-size: 1.8rem; font-weight: 700; letter-spacing: -0.5px; }
header p { color: var(--text-muted); font-size: 0.95rem; font-weight: 500; }

/* iOS Toggle Switch */
.ios-switch { position: relative; display: inline-block; width: 50px; height: 30px; flex-shrink: 0; }
.ios-switch input { opacity: 0; width: 0; height: 0; }
.ios-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #e9e9ea; transition: .4s; border-radius: 30px; }
.ios-slider:before { position: absolute; content: ""; height: 26px; width: 26px; left: 2px; bottom: 2px; background-color: white; transition: .4s; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
input:checked + .ios-slider { background-color: #34c759; }
body.dark-mode .ios-slider { background-color: #39393d; }
body.dark-mode input:checked + .ios-slider { background-color: #30d158; }
input:checked + .ios-slider:before { transform: translateX(20px); }

/* Cards */
.card {
    background: var(--card-bg); border-radius: var(--radius-card); box-shadow: var(--shadow);
    padding: 1.5rem; margin-bottom: 1.5rem; transition: background-color 0.3s ease;
}
.card h2 { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.5rem; letter-spacing: -0.3px; }
.section-subtitle { font-size: 1.05rem; font-weight: 600; color: var(--text-muted); margin: 1.5rem 0 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; font-size: 0.8rem;}
.help-text { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 1.25rem; font-weight: 500; }
.hidden { display: none !important; }

/* Forms & Inputs */
.form-group { margin-bottom: 1.25rem; }
label { display: block; font-weight: 600; margin-bottom: 0.4rem; font-size: 0.9rem; color: var(--text-main); }
input[type="text"], input[type="number"] {
    width: 100%; padding: 0.85rem 1rem; border: 2px solid transparent; background: var(--input-bg);
    border-radius: 12px; font-size: 1rem; color: var(--text-main); transition: border 0.2s, background 0.2s;
    font-family: inherit;
}
input[type="text"]:focus, input[type="number"]:focus {
    border-color: var(--primary); outline: none; background: var(--card-bg);
}
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media(min-width: 600px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* Checkboxes & Radios */
.checkbox-label, .radio-label { display: flex; align-items: center; gap: 0.5rem; font-weight: 500; cursor: pointer; }
.checkbox-label input, .radio-label input { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }

/* Buttons */
.btn {
    padding: 0.85rem 1.25rem; border: none; border-radius: var(--radius-btn);
    font-size: 1rem; font-weight: 600; cursor: pointer; transition: all 0.2s; font-family: inherit;
}
.btn-primary { background: var(--primary); color: white; box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3); }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-secondary { background: var(--input-bg); color: var(--primary); }
.btn-secondary:hover { filter: brightness(0.95); }
.btn-danger { background: rgba(255, 59, 48, 0.1); color: var(--danger); padding: 0.5rem 0.75rem; border-radius: 10px;}
.btn-large { width: 100%; font-size: 1.1rem; padding: 1.1rem; border-radius: 16px; }
.btn-text { background: transparent; color: var(--primary); }
.text-danger { color: var(--danger) !important; }

/* Lists */
.add-row { display: flex; gap: 0.75rem; margin-top: 1rem; }
.add-row input { flex: 1; }
.list-item { display: flex; justify-content: space-between; align-items: center; padding: 0.85rem 1rem; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: none; }
.driver-badge { font-size: 0.75rem; font-weight: 700; background: var(--primary); color: white; padding: 0.2rem 0.6rem; border-radius: 20px; margin-left: 0.5rem; text-transform: uppercase;}

/* Segments */
.segment-card { border: 1px solid var(--border); border-radius: 14px; padding: 1.25rem; margin-bottom: 1rem; background: var(--card-bg); }
.segment-header { font-weight: 600; margin-bottom: 0.75rem; display: flex; justify-content: space-between; align-items: center;}
.segment-actions { margin-top: 0.5rem; display: flex; gap: 0.5rem; align-items: center;}
.segment-actions input { width: 120px; text-align: right; }
.maps-link { font-size: 0.85rem; color: var(--primary); text-decoration: none; font-weight: 600; padding: 0.4rem 0.8rem; background: var(--input-bg); border-radius: 8px;}
.passenger-checkboxes { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border);}

/* Results */
.results-summary { background: var(--primary); color: white; padding: 1.5rem; border-radius: 16px; margin-bottom: 1.5rem; box-shadow: 0 8px 24px rgba(0, 113, 227, 0.4);}
.results-summary p { margin-bottom: 0.5rem; display: flex; justify-content: space-between; font-weight: 500;}
.results-summary p strong { font-weight: 700; font-size: 1.1rem;}
.result-row { display: flex; justify-content: space-between; align-items: center; padding: 1rem 0; border-bottom: 1px solid var(--border); }
.result-row:last-child { border-bottom: none; }
.amount { font-weight: 700; color: var(--primary); font-size: 1.25rem; }
.segment-result-row { padding: 1rem 0; border-bottom: 1px solid var(--border); }
.segment-result-row:last-child { border-bottom: none; }

.action-buttons { display: flex; gap: 1rem; margin-top: 2rem; }
.global-actions { display: flex; justify-content: center; gap: 2rem; margin-top: 2rem; }
.text-center { text-align: center; }
.inline-radio { display: flex; justify-content: center; gap: 1.5rem; margin-bottom: 1.5rem; }
