/**
 * IDC Calculator - Basic Structural Styles
 * 
 * These are foundational styles for layout and functionality.
 * Designer will update/override these with final branding styles.
 */

/* ============================================
   WRAPPER & CONTAINER
   ============================================ */

.idc-calculator-wrapper {
    margin: 0 auto;
    padding: 12px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
}

.idc-calculator-wrapper *,
.idc-calculator-wrapper *::before,
.idc-calculator-wrapper *::after {
    box-sizing: border-box;
}

/* ============================================
   TAB NAVIGATION
   ============================================ */

.idc-tabs {
    display: flex;
    flex-direction: column;
    gap: 0;
    /* border-bottom: 2px solid #e0e0e0; */
}

.idc-tab-btn {
    padding: 12px 20px;
    border: none;
    background: #f5f5f5;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 0;
    border: 1px solid transparent;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 0;
}

.idc-tab-btn:first-child {
    border-radius: 4px 4px 0 0;
}

.idc-tab-btn:hover {
    background: #e8e8e8;
    color: #333;
}

.idc-tab-btn.active {
    background: #0EA894;
    color: #fff;
    border-color: #0EA894;
}

/* ============================================
   TAB PANELS
   ============================================ */

.idc-tab-content {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 4px 4px;
    padding: 24px;
}

.idc-tab-panel {
    display: none;
}

.idc-tab-panel.active {
    display: block;
}

.idc-tab-panel h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 600;
    color: #222;
}

.idc-description {
    color: #666;
    font-size: 14px;
}

/* ============================================
   FORMS
   ============================================ */

.idc-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.idc-form-row {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.idc-form-group {
    flex: 1;
    min-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.idc-form-group label {
    font-size: 14px;
    font-weight: 500;
    color: #444;
}

.idc-required {
    color: #dc3545;
}

.idc-form-group input,
.idc-form-group select {
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.idc-form-group input:focus,
.idc-form-group select:focus {
    outline: none;
    border-color: #0EA894;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.idc-form-group input::placeholder {
    color: #999;
}

/* Error state for inputs */
.idc-form-group input.idc-input-error,
.idc-form-group select.idc-input-error {
    border-color: #dc3545;
}

.idc-form-group input.idc-input-error:focus,
.idc-form-group select.idc-input-error:focus {
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
}

/* ============================================
   ERROR MESSAGES
   ============================================ */

.idc-error {
    display: none;
    font-size: 12px;
    color: #dc3545;
    margin-top: 4px;
}

/* ============================================
   HINT TEXT
   ============================================ */

.idc-hint {
    font-size: 13px;
    color: #888;
    font-style: italic;
    margin: 8px 0;
}

/* ============================================
   BUTTONS
   ============================================ */

.idc-form-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.idc-btn {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: center;
}

.idc-btn-primary {
    background: #0EA894;
    color: #fff;
}

.idc-btn-primary:hover {
    background: #005a87;
}

.idc-btn-primary:active {
    background: #004a6e;
}

.idc-btn-secondary {
    background: #f0f0f0;
    color: #555;
}

.idc-btn-secondary:hover {
    background: #e0e0e0;
}

.idc-btn-secondary:active {
    background: #d0d0d0;
}

/* ============================================
   RESULTS
   ============================================ */

.idc-result {
    margin-top: 24px;
    padding: 20px;
    background: #f2f4f5;
    border-radius: 4px;
}

.idc-result-item {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.idc-result-item + .idc-result-item {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
}

.idc-result-label {
    font-size: 14px;
    font-weight: 500;
    color: #555;
}

.idc-result-value {
    font-size: 20px;
    font-weight: 700;
    color: #0EA894;
    font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
}

.idc-result-unit {
    font-size: 16px;
    color: #666;
    font-weight: 500;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (min-width: 768px) {

    .idc-tab-content {
        border-top: 1px solid #e0e0e0;
    }
    
    .idc-calculator-wrapper {
        padding: 20px;
    }

    .idc-tabs {
        flex-direction: row;
        gap: 4px;
    }

    .idc-tab-btn {
        border-radius: 4px 4px 0 0;
        border-bottom: none;
        margin-bottom: -2px;
    }

    .idc-tab-btn:first-child {
        border-radius: 4px 4px 0 0;
    }

    .idc-tab-btn.active {
        /* background: #fff; */
        /* color: #0EA894; */
        /* border-color: #e0e0e0; */
        /* border-bottom-color: #fff; */
    }

    .idc-form-row {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .idc-form-group {
        min-width: 200px;
    }

    .idc-form-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .idc-btn {
        width: auto;
    }

    .idc-result-value {
        font-size: 24px;
    }
}

@media (min-width: 1025px){
    .idc-calculator-wrapper {
        display: flex;
        flex-direction: row;
        padding: 0 40px 0 0;
    }

    .idc-tabs {
        flex-direction: column;
    }

    .idc-tab-btn:first-child {
        border-radius: 4px 0px 0px 0px;
    }

    .idc-tab-btn {
        border-radius: 0px;
    }

    .idc-tab-btn:last-child {
        border-radius: 0px 0px 0px 4px;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .idc-calculator-wrapper {
        max-width: 100%;
        padding: 0;
    }

    .idc-tabs {
        display: none;
    }

    .idc-tab-panel {
        display: block !important;
        page-break-inside: avoid;
        margin-bottom: 24px;
    }

    .idc-btn {
        display: none;
    }
}

