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

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

.user-header {
    background: white;
    padding: 10px 20px;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 20px;
}

.user-info {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
    font-size: 14px;
}

.user-info span {
    color: #555;
    font-weight: 500;
}

.dashboard-btn, .logout-btn {
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.dashboard-btn {
    background: #126fb9;
    color: white;
}

.dashboard-btn:hover {
    background: #0f5d9f;
}

.logout-btn {
    background: #dc3545;
    color: white;
}

.logout-btn:hover {
    background: #c82333;
}

@media (max-width: 768px) {
    .user-info {
        flex-direction: column;
        align-items: flex-end;
        gap: 8px;
    }
    
    .user-info span {
        font-size: 13px;
    }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    background-color: white;
    min-height: 100vh;
    box-shadow: 0 0 30px rgba(0,0,0,0.08);
    border-radius: 8px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid rgba(18, 111, 185, 0.1);
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.logo {
    max-width: 150px;
    max-height: 150px;
    object-fit: contain;
}

header h1 {
    color: #1e284b;
    font-size: 2.5em;
    font-weight: 600;
    margin: 0;
}

/* Top Inputs */
.top-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #ffffff 0%, #e4e5eb 100%);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid rgba(18, 111, 185, 0.1);
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #4a5568;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-group input {
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.input-group input:focus {
    outline: none;
    border-color: #126fb9;
    box-shadow: 0 0 0 3px rgba(18, 111, 185, 0.1);
    transform: translateY(-1px);
}

/* Model Tabs */
.model-tabs {
    display: flex;
    margin-bottom: 40px;
    background: white;
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid rgba(18, 111, 185, 0.1);
}

.tab-button {
    padding: 16px 32px;
    border: none;
    background-color: transparent;
    color: #718096;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin-right: 8px;
    position: relative;
}

.tab-button.active {
    background: linear-gradient(135deg, #126fb9 0%, #335577 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(18, 111, 185, 0.3);
    transform: translateY(-1px);
}

.tab-button:hover:not(.active) {
    background-color: #f7fafc;
    color: #4a5568;
    transform: translateY(-1px);
}

/* Phases */
.phase {
    margin-bottom: 50px;
    border: 1px solid rgba(18, 111, 185, 0.1);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    background: white;
}

.phase h2 {
    background: linear-gradient(135deg, #1e284b 0%, #335577 100%);
    color: white;
    padding: 25px 30px;
    margin: 0;
    font-size: 1.6em;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.step {
    border-bottom: 1px solid #ecf0f1;
    padding: 20px;
}

.step:last-child {
    border-bottom: none;
}

.step h3 {
    color: #1e284b;
    margin-bottom: 20px;
    font-size: 1.3em;
    border-bottom: 2px solid #e4e5eb;
    padding-bottom: 10px;
}

.sub-step {
    margin-bottom: 30px;
    border: 1px solid #ecf0f1;
    border-radius: 6px;
    padding: 15px;
}

.sub-step h4 {
    color: #1e284b;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.sub-step h5 {
    color: #335577;
    margin-bottom: 10px;
    font-size: 1em;
}

/* Panel Container */
.panel-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.panel {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 25px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    position: relative;
    transition: all 0.3s ease;
}

.panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

.panel.current-performance {
    border-left: 4px solid #335577;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fb 100%);
}

.panel.current-performance h3,
.panel.current-performance h4,
.panel.current-performance h5 {
    color: #335577;
}

.panel.optimized-target {
    border-left: 4px solid #126fb9;
    background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 100%);
}

.panel.optimized-target h3,
.panel.optimized-target h4,
.panel.optimized-target h5 {
    color: #126fb9;
}

/* Dropdown Values */
.dropdown-values {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

.dropdown-values select {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background-color: white;
    font-size: 14px;
    font-weight: 500;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dropdown-values select:focus {
    outline: none;
    border-color: #126fb9;
    box-shadow: 0 0 0 3px rgba(18, 111, 185, 0.1);
}

.dropdown-values span {
    font-weight: 700;
    color: #2d3748;
    padding: 12px 16px;
    background: linear-gradient(135deg, #edf2f7 0%, #e2e8f0 100%);
    border-radius: 8px;
    min-width: 100px;
    text-align: center;
    border: 1px solid #cbd5e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

/* Calculated and Output Fields */
.calculated-field,
.output-field {
    margin-top: 20px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #e2e8f0;
}

.output-field {
    background: linear-gradient(135deg, #f0f7ff 0%, #e4f3ff 100%);
    border-left: 4px solid #126fb9;
    border-color: #126fb9;
}

.calculated-field label,
.output-field label {
    font-weight: 600;
    color: #4a5568;
    font-size: 14px;
}

.calculated-field span,
.output-field span {
    font-weight: 800;
    color: #126fb9;
    font-size: 16px;
}

/* Offers Table */
.offers-table {
    border: 2px solid #e4e5eb;
    border-radius: 6px;
    overflow: hidden;
}

.table-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    border-bottom: 1px solid #e4e5eb;
}

.table-row:last-child {
    border-bottom: none;
}

.table-row.highlight {
    background-color: #e4e5eb;
    font-weight: 600;
}

.table-cell {
    padding: 12px;
    border-right: 1px solid #e4e5eb;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.table-cell:last-child {
    border-right: none;
}

.table-cell input {
    width: 100%;
    padding: 8px;
    border: 1px solid #335577;
    border-radius: 4px;
    text-align: center;
}

/* Totals Section */
.totals-section {
    margin-bottom: 80px;
    border: 3px solid #1e284b;
    border-radius: 8px;
    overflow: hidden;
}

.totals-section h2 {
    background-color: #1e284b;
    color: white;
    padding: 20px;
    margin: 0;
    text-align: center;
}

.totals-table {
    display: table;
    width: 100%;
}

.totals-row {
    display: table-row;
}

.totals-row.header-row {
    background: linear-gradient(135deg, #335577, #1e284b);
}

.totals-cell {
    display: table-cell;
    padding: 15px;
    border-bottom: 1px solid #e4e5eb;
    border-right: 1px solid #e4e5eb;
    text-align: center;
    vertical-align: middle;
    font-weight: 600;
}

.totals-cell.header-cell {
    background: linear-gradient(135deg, #335577, #1e284b);
    color: white;
    font-weight: 700;
    font-size: 1.1em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 18px 15px;
}

.totals-cell:last-child {
    border-right: none;
}

.totals-row:last-child .totals-cell {
    border-bottom: none;
}

.totals-cell.increase-percent {
    background: linear-gradient(135deg, #126fb9, #335577);
    color: white;
    font-size: 2em;
    font-weight: 700;
    vertical-align: middle;
}

.totals-cell input {
    width: 100%;
    padding: 10px;
    border: 2px solid #335577;
    border-radius: 4px;
    text-align: center;
    font-weight: 600;
}

/* Mobile-friendly totals cards */
.totals-cards {
    display: none;
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px;
}

.totals-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 2px solid #e4e5eb;
}

.totals-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e4e5eb;
}

.totals-card-title {
    font-size: 1.1em;
    font-weight: 700;
    color: #1e284b;
}

.totals-card-increase {
    background: linear-gradient(135deg, #126fb9, #335577);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1.1em;
}

.totals-card-values {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.totals-value-item {
    text-align: center;
}

.totals-value-label {
    font-size: 0.9em;
    color: #4a5568;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.totals-value-amount {
    font-size: 1.3em;
    font-weight: 700;
    color: #1e284b;
}

.totals-value-item.current .totals-value-amount {
    color: #335577;
}

.totals-value-item.optimized .totals-value-amount {
    color: #126fb9;
}

.totals-value-item.increase .totals-value-amount {
    color: #2d7d32;
}

.business-impact-card {
    background: linear-gradient(135deg, #f0f7ff 0%, #e4f3ff 100%);
    border-color: #126fb9;
}

.business-impact-input {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border: 2px solid #e4e5eb;
}

.business-impact-input label {
    font-weight: 600;
    color: #4a5568;
    font-size: 0.9em;
}

.business-impact-input input {
    padding: 8px 12px;
    border: 2px solid #335577;
    border-radius: 6px;
    width: 80px;
    text-align: center;
    font-weight: 600;
}

.overall-increase-highlight {
    background: linear-gradient(135deg, #126fb9, #335577);
    color: white;
    text-align: center;
    padding: 25px;
    border-radius: 12px;
    margin-top: 20px;
    box-shadow: 0 6px 20px rgba(18, 111, 185, 0.3);
}

.overall-increase-label {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 10px;
    opacity: 0.9;
}

.overall-increase-value {
    font-size: 2.5em;
    font-weight: 700;
}

/* Bottom Bar */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1e284b, #335577);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.bottom-bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.bottom-bar-item label {
    font-size: 12px;
    color: #e4e5eb;
    margin-bottom: 5px;
}

.bottom-bar-item span {
    font-size: 18px;
    font-weight: 700;
    color: #126fb9;
}

.export-button {
    background: linear-gradient(135deg, #126fb9, #335577);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(18, 111, 185, 0.3);
}

.export-button:hover {
    background: linear-gradient(135deg, #335577, #1e284b);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(18, 111, 185, 0.4);
}

.export-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(18, 111, 185, 0.3);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        padding: 15px;
        margin: 0;
        border-radius: 0;
    }
    
    .top-inputs {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
        padding: 20px;
    }
    
    .model-tabs {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .tab-button {
        padding: 12px 24px;
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header-content {
        gap: 15px;
    }
    
    .logo {
        max-width: 80px;
        max-height: 80px;
    }
    
    header h1 {
        font-size: 1.6em;
        text-align: center;
        line-height: 1.2;
    }
    
    .top-inputs {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px;
    }
    
    .input-group input {
        padding: 12px 14px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .model-tabs {
        flex-direction: column;
        gap: 8px;
    }
    
    .tab-button {
        width: 100%;
        padding: 16px;
        margin-right: 0;
        font-size: 16px;
    }
    
    .panel-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .panel {
        padding: 20px;
    }
    
    .dropdown-values {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .dropdown-values select,
    .dropdown-values span {
        width: 100%;
        text-align: center;
    }
    
    .table-row {
        grid-template-columns: 1fr;
        text-align: left;
    }
    
    .table-cell {
        border-right: none;
        border-bottom: 1px solid #e4e5eb;
        justify-content: flex-start;
        text-align: left;
        padding: 15px 12px;
    }
    
    .table-cell input {
        width: 100%;
        padding: 12px;
        font-size: 16px;
    }
    
    /* Hide table layout on mobile */
    .totals-table {
        display: none;
    }
    
    /* Show card layout on mobile */
    .totals-cards {
        display: grid;
    }
    
    .bottom-bar {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
        position: relative;
        margin-top: 20px;
    }
    
    .bottom-bar-item {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
    
    .bottom-bar-item span {
        font-size: 16px;
    }
    
    .export-button {
        width: 100%;
        padding: 16px 24px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.4em;
    }
    
    .phase h2 {
        font-size: 1.3em;
        padding: 20px 15px;
    }
    
    .step h3 {
        font-size: 1.1em;
    }
    
    .panel h4,
    .panel h5 {
        font-size: 1em;
    }
    
    .totals-cell {
        padding: 10px 6px;
        font-size: 12px;
    }
    
    .totals-cell.header-cell {
        font-size: 11px;
        padding: 12px 6px;
    }
    
    .totals-cell input {
        padding: 8px;
        font-size: 14px;
    }
}

/* Animation */
.panel, .step, .sub-step {
    transition: all 0.3s ease;
}

.panel:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

/* Touch-friendly mobile enhancements */
@media (max-width: 768px) {
    /* Increase touch targets */
    button, input, select {
        min-height: 44px;
        touch-action: manipulation;
    }
    
    /* Improve text readability */
    body {
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
    
    /* Remove hover effects on touch devices */
    .panel:hover {
        transform: none;
        box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    }
    
    .tab-button:hover:not(.active) {
        background-color: transparent;
        transform: none;
    }
    
    .input-group input:focus {
        transform: none;
    }
    
    /* Improve scroll behavior */
    .container {
        overflow-x: hidden;
    }
    
    /* Better spacing for mobile */
    .phase {
        margin-bottom: 30px;
    }
    
    .step {
        padding: 15px;
    }
    
    .sub-step {
        padding: 12px;
        margin-bottom: 20px;
    }
}

/* Hidden elements */
.hidden {
    display: none !important;
}

/* Hide number input spinners */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}
