/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Header */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 300;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    background-color: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background-color: #e9ecef;
    color: #333;
}

.tab-btn.active {
    background-color: #00bcd4;
    color: white;
    border-bottom-color: #0097a7;
}

/* Tab Content */
.tab-content {
    display: none;
    padding: 30px;
}

.tab-content.active {
    display: block;
}

/* Instruction Block */
.instruction-block {
    background-color: #e6f7ff;
    border: 1px solid #91d5ff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.instruction-block h3 {
    color: #003a8c;
    margin-bottom: 10px;
}

.instruction-block p {
    margin-bottom: 8px;
    color: #1f54b3;
}

.instruction-block em {
    font-style: italic;
    color: #595959;
}

.instruction-block ul {
    margin: 10px 0 10px 20px;
    color: #1f54b3;
}

.instruction-block li {
    margin-bottom: 4px;
}

/* Service Sections */
.service-section {
    margin-bottom: 40px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.service-header {
    background-color: #00bcd4; /* Cyan header */
    color: white;
    padding: 15px 20px;
    margin: 0;
    font-size: 1.3rem;
    font-weight: 500;
}

/* Comparison Layout */
.comparison-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.side {
    padding: 25px;
    border-right: 2px solid #e9ecef;
}

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

.side-header {
    background-color: #00bcd4; /* Cyan header */
    color: white;
    padding: 10px 15px;
    margin: -25px -25px 20px -25px;
    font-size: 1.1rem;
    font-weight: 500;
}

/* Input Groups */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.input-field {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    background-color: #ffeb3b; /* Yellow background for inputs */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.input-field:focus {
    outline: none;
    border-color: #00bcd4;
    box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.1);
}

/* Calculation Results */
.calculation-results {
    background-color: #fff5f5;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.calc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e5e5e5;
}

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

.calc-row.total {
    border-top: 2px solid #333;
    margin-top: 10px;
    padding-top: 15px;
    font-weight: bold;
    font-size: 1.1rem;
}

.calc-value {
    background-color: #ff9800; /* Orange background for calculations */
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: 500;
    min-width: 80px;
    text-align: right;
}

.total-value {
    font-size: 1.1rem;
    font-weight: bold;
}

/* Green highlighting for higher values */
.higher-value {
    background-color: #4caf50 !important;
    color: white !important;
    border: 1px solid #388e3c;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .tab-navigation {
        flex-direction: column;
    }

    .tab-btn {
        border-bottom: 1px solid #e9ecef;
        border-right: none;
    }

    .tab-btn.active {
        border-bottom-color: #e9ecef;
        border-left: 4px solid #00bcd4;
    }

    .comparison-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .side {
        border-right: none;
        border-bottom: 2px solid #e9ecef;
    }

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

    .side-header {
        margin: -25px -25px 20px -25px;
    }

    .tab-content {
        padding: 20px;
    }

    .instruction-block {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    header {
        padding: 20px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .tab-content {
        padding: 15px;
    }

    .side {
        padding: 20px;
    }

    .side-header {
        margin: -20px -20px 15px -20px;
        padding: 8px 12px;
        font-size: 1rem;
    }

    .calc-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .calc-value {
        align-self: flex-end;
    }
}

/* Additional styling for better visual hierarchy */
.service-section + .service-section {
    margin-top: 30px;
}

.input-field:invalid {
    border-color: #dc3545;
}

.input-field:valid {
    border-color: #28a745;
}

/* Loading state for calculations */
.calculating {
    opacity: 0.7;
    pointer-events: none;
}

/* Accessibility improvements */
.tab-btn:focus,
.input-field:focus {
    outline: 2px solid #00bcd4;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .tab-navigation {
        display: none;
    }
    
    .tab-content {
        display: block !important;
        page-break-after: always;
    }
    
    .tab-content:last-child {
        page-break-after: auto;
    }
}
