/* ===========================
   Global Styles & Variables
   =========================== */
:root {
    --primary-color: #FF6B35;
    --primary-gradient: linear-gradient(135deg, #FF8C42 0%, #FF6B35 50%, #E63946 100%);
    --yellow-bg: #FFFF00;
    --yellow-light: #FFFFE0;
    --green-bg: #90EE90;
    --green-light: #E8F5E9;
    --red-bg: #FF6B6B;
    --red-light: #FFE0E0;
    --text-primary: #000000;
    --text-secondary: #333333;
    --border-color: #000000;
    --card-bg: #FFFFFF;
    --light-bg: #F8F9FA;
}

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

body {
    font-family: 'Inter', 'Calibri', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--light-bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ===========================
   Header Styles
   =========================== */
.header {
    text-align: center;
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    border-top: 5px solid var(--primary-color);
}

.logo img {
    max-width: 280px;
    height: auto;
    margin-bottom: 20px;
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    border-bottom: 2px solid var(--text-primary);
    padding-bottom: 10px;
}

.header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 10px;
    border-bottom: 2px solid var(--text-primary);
    padding-bottom: 10px;
}

/* ===========================
   Simulator Card
   =========================== */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

/* ===========================
   Instructions Card
   =========================== */
.instructions-card {
    background: linear-gradient(135deg, #F8F9FA 0%, #E9ECEF 100%);
    border-left: 5px solid var(--primary-color);
}

.instructions-card h3 {
    color: var(--text-primary);
    font-size: 1.4rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.instructions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.instruction-box {
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.instruction-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.instruction-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-align: center;
}

.instruction-box h4 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    text-align: center;
}

.instruction-box p {
    font-size: 0.9rem;
    margin-bottom: 10px;
    line-height: 1.5;
}

.instruction-box ul {
    margin-left: 20px;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.instruction-box ul li {
    margin-bottom: 5px;
}

.tip {
    font-style: italic;
    font-weight: 600;
    margin-top: 10px;
    padding: 8px;
    border-radius: 5px;
    text-align: center;
}

.green-instruction {
    background: linear-gradient(135deg, #D4EDDA 0%, #C3E6CB 100%);
    border-left: 4px solid #28A745;
}

.green-instruction h4 {
    color: #155724;
}

.green-instruction .tip {
    background: rgba(40, 167, 69, 0.2);
    color: #155724;
}

.red-instruction {
    background: linear-gradient(135deg, #F8D7DA 0%, #F5C6CB 100%);
    border-left: 4px solid #DC3545;
}

.red-instruction h4 {
    color: #721C24;
}

.red-instruction .tip {
    background: rgba(220, 53, 69, 0.2);
    color: #721C24;
}

.yellow-instruction {
    background: linear-gradient(135deg, #FFF3CD 0%, #FFE8A1 100%);
    border-left: 4px solid #FFC107;
}

.yellow-instruction h4 {
    color: #856404;
}

.yellow-instruction .tip {
    background: rgba(255, 193, 7, 0.2);
    color: #856404;
}

.simulator-card {
    overflow-x: auto;
}

/* ===========================
   Table Structure (Excel-like)
   =========================== */
.simulator-table {
    width: 100%;
    border: 2px solid var(--border-color);
    background: white;
}

.table-header {
    display: grid;
    grid-template-columns: 3fr 1fr 1.5fr 1.5fr;
    border-bottom: 2px solid var(--border-color);
    background: white;
}

.header-cell {
    padding: 15px 10px;
    font-weight: 700;
    border-right: 1px solid var(--border-color);
    text-align: center;
    background: white;
}

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

.header-cell.scenario-col {
    font-size: 0.95rem;
}

.header-cell .small {
    font-size: 0.75rem;
    font-weight: 400;
    display: block;
    margin-top: 5px;
    line-height: 1.3;
}

/* ===========================
   Table Rows
   =========================== */
.table-row {
    display: grid;
    grid-template-columns: 3fr 1fr 1.5fr 1.5fr;
    border-bottom: 1px solid var(--border-color);
}

.cell {
    padding: 12px 10px;
    border-right: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

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

.label-col {
    text-align: left;
    font-weight: 500;
}

.value-col {
    text-align: center;
    justify-content: center;
}

.scenario-col {
    text-align: right;
    justify-content: flex-end;
    font-weight: 600;
}

/* ===========================
   Color Coded Rows
   =========================== */
.yellow-row {
    background: var(--yellow-bg);
}

.yellow-row .cell {
    background: var(--yellow-bg);
}

.red-row {
    background: var(--red-bg);
}

.red-row .cell {
    background: var(--red-bg);
}

.green-row {
    background: var(--green-bg);
}

.green-row .cell {
    background: var(--green-bg);
}

.neutral-row {
    background: #E8F4F8;
}

.neutral-row .cell {
    background: #E8F4F8;
}

/* Field Tags */
.field-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.green-tag {
    background: #28A745;
    color: white;
}

.red-tag {
    background: #DC3545;
    color: white;
}

.neutral-tag {
    background: #17A2B8;
    color: white;
}

.total-row {
    font-weight: 700;
    font-size: 1.05rem;
}

/* ===========================
   Input Styles
   =========================== */
.editable-input {
    width: 90px;
    padding: 6px;
    border: 2px solid #333;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    background: white;
    text-align: right;
}

.editable-input.center {
    text-align: center;
    width: 70px;
}

.editable-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.2);
}

.readonly-cell {
    background: #F0F0F0 !important;
    font-weight: 600;
}

/* ===========================
   Button Styles
   =========================== */
.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 30px;
}

.btn {
    padding: 14px 32px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.btn-secondary {
    background: #6C757D;
    color: white;
}

.btn-secondary:hover {
    background: #5A6268;
    transform: translateY(-2px);
}

.btn-download {
    background: linear-gradient(135deg, #3498DB 0%, #2980B9 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

/* ===========================
   Footer Styles
   =========================== */
.footer {
    text-align: center;
    padding: 30px 20px;
    color: #666;
    font-size: 0.9rem;
}

.footer p {
    margin: 5px 0;
}

.disclaimer {
    font-style: italic;
    font-size: 0.85rem;
    max-width: 800px;
    margin: 10px auto 0;
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 1200px) {
    .table-header,
    .table-row {
        grid-template-columns: 2.5fr 1fr 1.5fr 1.5fr;
    }
}

@media (max-width: 992px) {
    .header h1 {
        font-size: 1.6rem;
    }
    
    .header h2 {
        font-size: 1.2rem;
    }
    
    .logo img {
        max-width: 220px;
    }
    
    .simulator-card {
        padding: 15px;
    }
    
    .table-header,
    .table-row {
        font-size: 0.9rem;
    }
    
    .cell {
        padding: 10px 8px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 1.4rem;
    }
    
    .header h2 {
        font-size: 1.1rem;
    }
    
    .logo img {
        max-width: 180px;
    }
    
    .table-header,
    .table-row {
        grid-template-columns: 2fr 0.8fr 1.2fr 1.2fr;
        font-size: 0.85rem;
    }
    
    .cell {
        padding: 8px 5px;
    }
    
    .editable-input {
        font-size: 0.9rem;
        padding: 6px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .header {
        padding: 20px 15px;
    }
    
    .header h1 {
        font-size: 1.2rem;
    }
    
    .header h2 {
        font-size: 1rem;
    }
    
    .logo img {
        max-width: 150px;
    }
    
    .simulator-card {
        padding: 10px;
    }
    
    .table-header,
    .table-row {
        font-size: 0.75rem;
    }
    
    .header-cell,
    .cell {
        padding: 6px 4px;
    }
    
    .editable-input {
        font-size: 0.85rem;
        padding: 5px;
    }
    
    .editable-input.center {
        width: 60px;
    }
}

/* ===========================
   Print Styles
   =========================== */
@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .button-group {
        display: none;
    }
    
    .footer {
        page-break-after: avoid;
    }
}
