/**
 * BlueBin Cost of Delay Calculator - Stylesheet
 * Two-column layout optimized for 1080px width
 */

/* ===== CONTAINER ===== */
.cost-calculator-container {
    font-family: objektiv-mk1, Arial, sans-serif;
    background-color: #f8f9fa;
    padding: 40px 20px;
    max-width: 1080px;
    margin: 0 auto;
}

/* ===== HEADER ===== */
.calc-header {
    text-align: center;
    margin-bottom: 40px;
}

.calc-title {
    font-size: 36px;
    font-weight: bold;
    color: #0971ce;
    margin-bottom: 12px;
    line-height: 1.2;
}

.calc-subtitle {
    font-size: 24px;
    color: #6c757d;
    font-weight: 500;
    margin-bottom: 8px;
}

.calc-description {
    font-size: 16px;
    color: #6c757d;
    line-height: 1.5;
    max-width: 800px;
    margin: 0 auto;
}

/* ===== TWO COLUMN LAYOUT ===== */
.calc-two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.calc-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ===== CARDS ===== */
.calc-card {
    background-color: white;
    padding: 28px;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.1);
}

.calc-card.danger-border {
    border: 3px solid #dc3545;
}

.calc-card-title {
    font-size: 22px;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
}

.calc-card-title.danger {
    color: #dc3545;
}

/* ===== INPUT GROUPS ===== */
.input-group {
    margin-bottom: 20px;
}

.input-group:last-child {
    margin-bottom: 0;
}

.input-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

.input-label.danger {
    color: #dc3545;
}

.calc-input {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.calc-input:focus {
    outline: none;
    border-color: #0971ce;
}

.input-hint {
    font-size: 13px;
    color: #6c757d;
    margin-top: 4px;
}

/* ===== SLIDER ===== */
.slider-container {
    width: 100%;
    margin-bottom: 8px;
}

.calc-slider {
    width: 100%;
    height: 6px !important;
    border-radius: 3px;
    background: #dee2e6 !important;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

/* WebKit browsers (Chrome, Safari, Edge) */
.calc-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px !important;
    background: #dee2e6 !important;
    border-radius: 3px;
    border: none !important;
}

.calc-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #dc3545;
    cursor: pointer;
    margin-top: -7px;
}

/* Firefox */
.calc-slider::-moz-range-track {
    width: 100%;
    height: 6px !important;
    background: #dee2e6 !important;
    border-radius: 3px;
    border: none !important;
}

.calc-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #dc3545;
    cursor: pointer;
    border: none;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #6c757d;
}

.slider-value {
    font-size: 16px;
    font-weight: bold;
    color: #dc3545;
}

/* ===== TOTAL COST BOX ===== */
.total-cost-box {
    background-color: #fff3cd;
    border: 3px solid #ffc107;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(255, 193, 7, 0.2);
}

.total-cost-label {
    font-size: 14px;
    color: #856404;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.total-cost-value {
    font-size: 48px;
    font-weight: bold;
    color: #dc3545;
    line-height: 1;
    margin: 10px 0;
}

.total-cost-subtext {
    font-size: 14px;
    color: #856404;
    margin-top: 10px;
}

/* ===== METRIC BOXES ===== */
.metric-box {
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.metric-box.danger {
    background-color: #dc3545;
    color: white;
}

.metric-box.success {
    background-color: #d4edda;
    border: 2px solid #28a745;
}

.metric-label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    opacity: 0.9;
}

.metric-box.success .metric-label {
    color: #155724;
}

.metric-value {
    font-size: 32px;
    font-weight: bold;
}

.metric-box.success .metric-value {
    color: #28a745;
}

/* ===== SAVINGS BREAKDOWN ===== */
.savings-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 15px 0;
    border-bottom: 1px solid #dee2e6;
}

.savings-item:last-child {
    border-bottom: none;
}

.savings-item.total {
    padding-top: 20px;
    margin-top: 10px;
    border-top: 2px solid #0971ce;
    border-bottom: none;
}

.savings-label {
    font-size: 15px;
    color: #495057;
    font-weight: 500;
}

.savings-item.total .savings-label {
    font-size: 17px;
    font-weight: bold;
    color: #333;
}

.savings-detail {
    font-size: 13px;
    color: #6c757d;
    margin-top: 4px;
    font-weight: normal;
}

.savings-value {
    font-size: 20px;
    font-weight: bold;
    color: #0971ce;
    white-space: nowrap;
}

.savings-item.total .savings-value {
    font-size: 24px;
}

.savings-divider {
    height: 2px;
    background-color: #dee2e6;
    margin: 10px 0;
}

/* ===== INSIGHTS CARD ===== */
.insights-card {
    background: linear-gradient(135deg, #0971ce 0%, #065ba3 100%);
    color: white;
}

.insights-card .calc-card-title {
    color: white;
}

.insight-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.insight-item:last-child {
    border-bottom: none;
}

.insight-icon {
    font-size: 32px;
    width: 45px;
    text-align: center;
}

.insight-label {
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 5px;
}

.insight-value {
    font-size: 22px;
    font-weight: bold;
}

/* ===== CTA BUTTON ===== */
.cta-button {
    width: 100%;
    padding: 18px 32px;
    font-size: 18px;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4);
}

.cta-button:active {
    transform: translateY(0);
}

.cta-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cta-text {
    font-size: 14px;
    color: #6c757d;
    text-align: center;
    margin-top: 15px;
    line-height: 1.5;
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 40px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    position: relative;
    animation: slideIn 0.3s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 32px;
    font-weight: bold;
    color: #6c757d;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #333;
}

.modal-title {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.modal-description {
    font-size: 15px;
    color: #6c757d;
    margin-bottom: 25px;
}

/* ===== FORM STYLES ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #0971ce;
}

.submit-button {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, #0971ce 0%, #065ba3 100%);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(9, 113, 206, 0.3);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ===== SPINNER ===== */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1100px) {
    .cost-calculator-container {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .calc-two-column {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .calc-title {
        font-size: 28px;
    }

    .calc-subtitle {
        font-size: 18px;
    }

    .total-cost-value {
        font-size: 36px;
    }

    .metric-value {
        font-size: 24px;
    }

    .modal-content {
        padding: 30px 20px;
    }
}

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

    .calc-card {
        padding: 20px;
    }

    .calc-title {
        font-size: 24px;
    }

    .total-cost-value {
        font-size: 32px;
    }

    .cta-button {
        font-size: 16px;
        padding: 14px 24px;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .modal,
    .cta-button {
        display: none !important;
    }
}