/* FuelTripCalculator.com - Complete CSS */
:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --text: #1f2937;
    --text-light: #6b7280;
    --border: #e5e7eb;
    --bg: #ffffff;
    --bg-alt: #f9fafb;
    --error: #dc2626;
    --success: #059669;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg-alt);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header with Black Background */
header {
    background: #000000;
    border-bottom: 1px solid #1f1f1f;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    gap: 1rem;
}

.brand {
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand::before {
    content: "⛽";
    font-size: 1.5rem;
}

/* Desktop Navigation */
nav ul {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    align-items: center;
}

nav a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

nav a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
}

.menu-overlay {
    display: none;
}

/* Hero Section */
.hero {
    padding: 2rem 0;
    text-align: center;
}

h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.hero p {
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* Calculator Card */
.calc-card {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    margin: 0 auto 2rem;
}

.error-msg {
    background: #fee;
    color: var(--error);
    padding: 0.75rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    display: none;
}

.error-msg.show {
    display: block;
}

.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.input-row {
    display: flex;
    gap: 0.5rem;
}

input,
select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.2s;
}

input:focus,
select:focus {
    outline: 2px solid var(--primary);
    outline-offset: 0;
    border-color: var(--primary);
}

input[type="number"] {
    flex: 2;
}

select {
    flex: 1;
}

.currency-input {
    flex: 0 0 80px;
}

.btn-group {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

button {
    flex: 1;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-primary:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.btn-secondary {
    background: var(--bg-alt);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

/* Results */
.results {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border);
    display: none;
}

.results.show {
    display: block;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.result-item:last-child {
    border-bottom: none;
}

.result-label {
    color: var(--text-light);
    font-size: 0.9rem;
}

.result-value {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
}

/* Content Sections */
.content {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 2rem;
    margin: 2rem auto;
    max-width: 800px;
    box-shadow: var(--shadow);
}

h2 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
    color: var(--text);
}

h3 {
    font-size: 1.2rem;
    margin: 1.5rem 0 0.75rem;
    color: var(--text);
}

p {
    margin-bottom: 1rem;
}

.formula {
    background: var(--bg-alt);
    padding: 1rem;
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
    margin: 1rem 0;
    font-family: "Courier New", monospace;
}

.example {
    background: #f0f9ff;
    padding: 1rem;
    border-radius: var(--radius);
    margin: 1rem 0;
}

ul,
ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.5rem;
}

/* FAQ */
.faq-item {
    margin-bottom: 1.5rem;
}

.faq-q {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

th,
td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--bg-alt);
    font-weight: 600;
}

/* Links */
.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.link-card {
    background: var(--bg);
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
}

.link-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.link-card h3 {
    margin: 0 0 0.5rem;
    color: var(--primary);
}

/* Footer */
footer {
    background: var(--bg);
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    list-style: none;
    margin-bottom: 1rem;
}

.footer-links a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-text {
    text-align: center;
    color: var(--text-light);
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 640px) {
    h1 {
        font-size: 1.75rem;
    }

    .calc-card {
        padding: 1rem;
    }

    .btn-group {
        flex-direction: column;
    }

    .content {
        padding: 1.5rem;
    }
}

@media (min-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    .hero {
        padding: 3rem 0;
    }
}

/* Mobile Menu */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        width: 40px;
        height: 40px;
        cursor: pointer;
        position: relative;
        padding: 0;
    }

    .mobile-menu-btn::before,
    .mobile-menu-btn::after {
        content: '';
        position: absolute;
        width: 20px;
        height: 2px;
        background: #ffffff;
        transition: all 0.3s ease;
        left: 10px;
    }

    .mobile-menu-btn::before {
        top: 12px;
        box-shadow: 0 6px 0 #ffffff;
    }

    .mobile-menu-btn::after {
        top: 24px;
    }

    .mobile-menu-btn.active::before {
        top: 18px;
        transform: rotate(45deg);
        box-shadow: none;
    }

    .mobile-menu-btn.active::after {
        top: 18px;
        transform: rotate(-45deg);
    }

    nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: #000000;
        box-shadow: -2px 0 8px rgba(0, 0, 0, 0.5);
        transition: right 0.3s ease;
        z-index: 1001;
        overflow-y: auto;
    }

    nav.active {
        right: 0;
    }

    nav ul {
        flex-direction: column;
        padding: 5rem 1.5rem 2rem;
        gap: 0.5rem;
    }

    nav li {
        width: 100%;
    }

    nav a {
        display: block;
        padding: 0.875rem 1rem;
        color: rgba(255, 255, 255, 0.85);
        font-size: 1rem;
        border-radius: 8px;
    }

    nav a:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #ffffff;
    }

    nav::before {
        content: '✕';
        position: absolute;
        top: 1.25rem;
        right: 1.25rem;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: rgba(255, 255, 255, 0.7);
        font-size: 1.5rem;
        cursor: pointer;
        border-radius: 6px;
        transition: all 0.2s ease;
    }

    nav::before:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #ffffff;
    }

    nav::after {
        content: '⛽ FuelTripCalculator';
        position: absolute;
        top: 1.5rem;
        left: 1.5rem;
        color: #ffffff;
        font-size: 1.125rem;
        font-weight: 600;
    }

    .menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0);
        z-index: 1000;
        transition: background 0.3s ease;
        pointer-events: none;
    }

    .menu-overlay.active {
        display: block;
        background: rgba(0, 0, 0, 0.5);
        pointer-events: auto;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    nav ul {
        gap: 0.25rem;
    }

    nav a {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}
