* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Ideal Direct Brand Colors */
    --navy-dark: #0f1419;
    --navy-main: #1a2332;
    --navy-card: #2a3b4d;
    --navy-lighter: #374151;
    --blue-primary: #4169e1;
    --blue-hover: #5a7fea;
    --red-accent: #ef4444;
    --red-hover: #f56565;

    /* Text Colors */
    --text-white: #ffffff;
    --text-gray: #9ca3af;
    --text-light: #d1d5db;

    /* UI Elements */
    --border-color: #374151;
    --input-bg: #1e293b;
    --success-green: #10b981;
    --warning-yellow: #f59e0b;
    --danger-red: #ef4444;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Roboto', sans-serif;
    background: var(--navy-dark);
    color: var(--text-white);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Header Styles */
.header {
    background: var(--navy-main);
    border-radius: 12px;
    padding: 30px 40px;
    margin-bottom: 30px;
    position: relative;
    border: 1px solid var(--border-color);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.logo-badge {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ef4444 0%, #4169e1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
    color: white;
    box-shadow: 0 4px 12px rgba(65, 105, 225, 0.3);
}

.logo-title {
    font-size: 28px;
    font-weight: 300;
    letter-spacing: 2px;
    color: var(--text-white);
}

.page-title {
    font-size: 32px;
    font-weight: 400;
    color: var(--text-white);
    margin-top: 10px;
}

.reset-btn {
    position: absolute;
    top: 30px;
    right: 40px;
    background: transparent;
    border: 1px solid var(--red-accent);
    color: var(--red-accent);
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.reset-btn:hover {
    background: var(--red-accent);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Content Wrapper */
.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

/* Panel Styles */
.input-panel,
.results-panel {
    background: var(--navy-main);
    border-radius: 12px;
    padding: 30px;
    border: 1px solid var(--border-color);
}

.panel-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.panel-header h3 {
    font-size: 24px;
    font-weight: 500;
    color: var(--text-white);
    margin-bottom: 8px;
}

.panel-subtitle {
    font-size: 14px;
    color: var(--text-gray);
}

/* Input Sections */
.input-section {
    margin-bottom: 30px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-white);
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.input-label {
    display: block;
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 8px;
    margin-top: 15px;
    font-weight: 500;
}

.input-field {
    width: 100%;
    padding: 12px 16px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-white);
    font-size: 15px;
    transition: all 0.3s ease;
}

.input-field:focus {
    outline: none;
    border-color: var(--blue-primary);
    box-shadow: 0 0 0 3px rgba(65, 105, 225, 0.1);
}

.input-field::placeholder {
    color: var(--text-gray);
}

/* Results Sections */
.results-section {
    background: var(--navy-card);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.results-section.highlight {
    background: linear-gradient(135deg, rgba(65, 105, 225, 0.1) 0%, rgba(65, 105, 225, 0.05) 100%);
    border: 1px solid rgba(65, 105, 225, 0.3);
}

/* Metric Rows */
.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(55, 65, 81, 0.5);
}

.metric-row:last-child {
    border-bottom: none;
}

.metric-label {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 500;
}

.metric-value {
    font-size: 16px;
    color: var(--text-white);
    font-weight: 600;
}

.metric-value.large {
    font-size: 20px;
}

.metric-row.negative .metric-value {
    color: var(--red-accent);
}

.metric-row.total {
    padding: 16px 0;
    border-top: 2px solid var(--border-color);
    border-bottom: 2px solid var(--border-color);
    margin: 10px 0;
}

.metric-row.total .metric-value {
    color: var(--success-green);
    font-size: 18px;
}

.metric-row.margin .metric-value {
    color: var(--blue-primary);
}

/* Health Indicator */
.health-indicator {
    background: var(--navy-card);
    border-radius: 10px;
    padding: 24px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
    border: 1px solid var(--border-color);
}

.health-indicator.healthy {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
    border-color: rgba(16, 185, 129, 0.3);
}

.health-indicator.warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
    border-color: rgba(245, 158, 11, 0.3);
}

.health-indicator.danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
    border-color: rgba(239, 68, 68, 0.3);
}

.health-icon {
    font-size: 36px;
    line-height: 1;
}

.health-text {
    flex: 1;
}

.health-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-white);
    margin-bottom: 6px;
}

.health-description {
    font-size: 14px;
    color: var(--text-gray);
    line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }

    .reset-btn {
        position: static;
        margin-top: 20px;
        width: fit-content;
    }
}

@media (max-width: 640px) {
    body {
        padding: 10px;
    }

    .header {
        padding: 20px;
    }

    .logo-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-title {
        font-size: 24px;
    }

    .input-panel,
    .results-panel {
        padding: 20px;
    }

    .metric-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* Marketplace Selector */
.marketplace-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 10px;
}

.marketplace-btn {
    padding: 14px 20px;
    background: var(--navy-card);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-light);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.marketplace-btn:hover {
    border-color: var(--blue-primary);
    background: rgba(65, 105, 225, 0.1);
}

.marketplace-btn.active {
    background: linear-gradient(135deg, var(--blue-primary) 0%, #5a7fea 100%);
    border-color: var(--blue-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(65, 105, 225, 0.3);
}

.marketplace-note {
    font-size: 13px;
    color: var(--text-gray);
    margin-top: 8px;
    font-style: italic;
}

/* Landed Cost Section */
.landed-cost-result {
    background: linear-gradient(135deg, rgba(65, 105, 225, 0.15) 0%, rgba(65, 105, 225, 0.05) 100%);
    border: 1px solid rgba(65, 105, 225, 0.3);
    border-radius: 8px;
    padding: 16px;
    margin: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.landed-cost-result .metric-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-white);
}

.landed-cost-result .metric-value {
    font-size: 22px;
    color: var(--blue-primary);
    font-weight: 700;
}

.btn-secondary {
    width: 100%;
    padding: 12px 20px;
    background: var(--blue-primary);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: var(--blue-hover);
    box-shadow: 0 4px 12px rgba(65, 105, 225, 0.3);
    transform: translateY(-2px);
}

.field-hint {
    display: block;
    font-size: 12px;
    color: var(--text-gray);
    margin-top: 4px;
    margin-bottom: 12px;
}

.input-field.calculated {
    background: rgba(65, 105, 225, 0.1);
    border-color: rgba(65, 105, 225, 0.3);
    cursor: not-allowed;
}

.info-badge {
    font-size: 14px;
    margin-left: 6px;
    cursor: help;
    opacity: 0.7;
}

/* Number Input Styling */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    opacity: 1;
    height: 40px;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--navy-main);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--blue-primary);
}
