/* Calculator Shared Styles */

/* ========================================
   Base Layout
   ======================================== */

.calculator-page {
    max-width: 900px;
    margin: 0 auto;
    padding: clamp(15px, 4vw, 40px);
}

.calculator-header {
    text-align: center;
    margin-bottom: 30px;
}

.calculator-header h1 {
    font-size: clamp(24px, 5vw, 32px);
    color: #333;
    margin-bottom: 10px;
}

.calculator-header p {
    color: #666;
    font-size: clamp(14px, 3vw, 16px);
}

.calculator-breadcrumb {
    font-size: clamp(12px, 2.5vw, 14px);
    color: #666;
    margin-bottom: 20px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.calculator-breadcrumb a {
    color: #0073ea;
    text-decoration: none;
}

.calculator-breadcrumb a:hover {
    text-decoration: underline;
}

/* ========================================
   Calculator Container
   ======================================== */

.calculator-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.calculator-inputs,
.calculator-results {
    background: #f8f9fa;
    padding: clamp(15px, 4vw, 25px);
    border-radius: 12px;
}

.calculator-inputs {
    border: 2px solid #e9ecef;
}

.calculator-results {
    border: 2px solid #0073ea;
    background: linear-gradient(135deg, #f8f9fa 0%, #e7f5ff 100%);
}

/* ========================================
   Form Elements
   ======================================== */

.calc-section-title {
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0073ea;
}

.calc-field {
    margin-bottom: 20px;
}

.calc-field label {
    display: block;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
    font-size: 0.95em;
}

.calc-field-hint {
    display: block;
    font-size: 0.85em;
    color: #666;
    margin-top: 4px;
}

.calc-input {
    width: 100%;
    padding: 12px 15px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.calc-input:focus {
    outline: none;
    border-color: #0073ea;
    box-shadow: 0 0 0 3px rgba(0, 115, 234, 0.1);
}

.calc-input-group {
    display: flex;
    align-items: stretch;
}

.calc-input-group .calc-input {
    border-radius: 8px 0 0 8px;
    flex: 1;
}

.calc-input-prefix,
.calc-input-suffix {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 15px;
    background: #e9ecef;
    border: 2px solid #ddd;
    font-weight: 500;
    color: #666;
}

.calc-input-prefix {
    border-radius: 8px 0 0 8px;
    border-right: none;
}

.calc-input-prefix + .calc-input {
    border-radius: 0 8px 8px 0;
}

.calc-input-suffix {
    border-radius: 0 8px 8px 0;
    border-left: none;
}

.calc-input-group .calc-input:not(:first-child):not(:last-child) {
    border-radius: 0;
}

/* Select styling */
.calc-select {
    width: 100%;
    padding: 12px 15px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.calc-select:focus {
    outline: none;
    border-color: #0073ea;
}

/* Radio/Checkbox groups */
.calc-radio-group,
.calc-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.calc-radio-label,
.calc-checkbox-label {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.calc-radio-label:hover,
.calc-checkbox-label:hover {
    border-color: #0073ea;
}

.calc-radio-label input,
.calc-checkbox-label input {
    margin-right: 8px;
}

.calc-radio-label input:checked + span,
.calc-checkbox-label input:checked + span {
    color: #0073ea;
    font-weight: 500;
}

.calc-radio-label:has(input:checked),
.calc-checkbox-label:has(input:checked) {
    border-color: #0073ea;
    background: #e7f5ff;
}

/* ========================================
   Results Display
   ======================================== */

.calc-result-title {
    font-size: 1.1em;
    font-weight: 600;
    color: #0073ea;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0073ea;
}

.calc-result-item {
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.calc-result-label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.calc-result-value {
    font-size: clamp(20px, 4vw, 28px);
    font-weight: 700;
    color: #333;
}

.calc-result-value.highlight {
    color: #0073ea;
}

.calc-result-value.success {
    color: #28a745;
}

.calc-result-value.warning {
    color: #ffc107;
}

.calc-result-value.danger {
    color: #dc3545;
}

.calc-result-note {
    font-size: 0.85em;
    color: #666;
    margin-top: 5px;
}

/* Result breakdown table */
.calc-breakdown {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.calc-breakdown th,
.calc-breakdown td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.calc-breakdown th {
    font-weight: 500;
    color: #666;
    font-size: 0.9em;
}

.calc-breakdown td {
    font-weight: 600;
    color: #333;
}

.calc-breakdown tr:last-child th,
.calc-breakdown tr:last-child td {
    border-bottom: none;
}

.calc-breakdown .total-row {
    background: #e7f5ff;
}

.calc-breakdown .total-row th,
.calc-breakdown .total-row td {
    font-weight: 700;
    color: #0073ea;
}

/* ========================================
   Buttons
   ======================================== */

.calc-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 48px;
}

.calc-button-primary {
    background: #0073ea;
    color: white;
}

.calc-button-primary:hover {
    background: #005bb5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 115, 234, 0.3);
}

.calc-button-secondary {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #ddd;
}

.calc-button-secondary:hover {
    background: #e9ecef;
}

.calc-button-full {
    width: 100%;
}

/* ========================================
   Info Boxes
   ======================================== */

.calc-info {
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    font-size: 0.9em;
}

.calc-info-blue {
    background: #e7f5ff;
    border-left: 4px solid #0073ea;
    color: #333;
}

.calc-info-yellow {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    color: #856404;
}

.calc-info-green {
    background: #d4edda;
    border-left: 4px solid #28a745;
    color: #155724;
}

.calc-info-title {
    font-weight: 600;
    margin-bottom: 8px;
}

/* ========================================
   Calculator Hub/Index Page
   ======================================== */

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

.calculator-card {
    display: block;
    padding: 25px;
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 12px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s;
}

.calculator-card:hover {
    background: #e7f5ff;
    border-color: #0073ea;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 115, 234, 0.15);
}

.calculator-card-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 15px;
    color: #0073ea;
}

.calculator-card-title {
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 8px;
}

.calculator-card-desc {
    font-size: 0.95em;
    color: #666;
    line-height: 1.5;
}

/* ========================================
   Comparison Tables
   ======================================== */

.calc-comparison {
    width: 100%;
    overflow-x: auto;
    margin-top: 20px;
}

.calc-comparison table {
    width: 100%;
    min-width: 500px;
    border-collapse: collapse;
}

.calc-comparison th,
.calc-comparison td {
    padding: 12px 15px;
    text-align: center;
    border: 1px solid #e9ecef;
}

.calc-comparison thead th {
    background: #0073ea;
    color: white;
    font-weight: 600;
}

.calc-comparison tbody th {
    background: #f8f9fa;
    text-align: left;
    font-weight: 500;
}

.calc-comparison tbody tr:hover {
    background: #f8f9fa;
}

.calc-comparison .highlight-col {
    background: #e7f5ff;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
    .calculator-container {
        grid-template-columns: 1fr;
    }

    .calc-radio-group,
    .calc-checkbox-group {
        flex-direction: column;
    }

    .calc-radio-label,
    .calc-checkbox-label {
        width: 100%;
    }

    .calc-comparison {
        font-size: 14px;
    }

    .calc-comparison th,
    .calc-comparison td {
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .calculator-page {
        padding: 15px;
    }

    .calculator-inputs,
    .calculator-results {
        padding: 15px;
    }

    .calc-input,
    .calc-select,
    .calc-button {
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .calc-result-value {
        font-size: 22px;
    }

    .calc-breakdown th,
    .calc-breakdown td {
        padding: 8px;
        font-size: 14px;
    }
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    .calculator-page {
        max-width: 100%;
        padding: 0;
    }

    .calculator-inputs,
    .calculator-results {
        break-inside: avoid;
    }

    .calc-button {
        display: none;
    }
}
