/**
 * BT Indexing Calculator Styles
 *
 * @package BTIndexingCalculator
 * @version 2.0.0
 */

/* ==========================================================================
   Base Container
   ========================================================================== */

.btic-calculator {
    width: 100%;
    max-width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

.btic-calculator .container-fluid {
    padding: 0;
}

/* ==========================================================================
   Cards
   ========================================================================== */

.btic-card {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 5px 0 rgba(0, 0, 0, 0.2);
    margin-bottom: 15px;
}

.btic-controls-card {
    padding: 15px;
}

.btic-chart-card {
    padding: 20px 15px 5px;
}

.btic-table-card {
    padding: 0;
}

/* ==========================================================================
   Form Controls
   ========================================================================== */

.btic-calculator select,
.btic-calculator .form-select {
    height: 32px;
    border: 1px solid #d0d0d0;
    font-size: 14px;
    font-weight: 500;
    padding: 0 10px;
    width: 100%;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 16px 12px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.btic-calculator input[type="text"],
.btic-calculator .form-control {
    height: 32px;
    border: 1px solid #d0d0d0;
    font-size: 14px;
    font-weight: 500;
    padding: 0 10px;
    width: 100%;
    margin: 2px 0;
}

.btic-calculator input:focus,
.btic-calculator select:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.btic-calculator label {
    font-size: 14px;
    font-weight: 500;
    margin: 0;
    line-height: 17px;
    display: block;
}

/* ==========================================================================
   Form Sections
   ========================================================================== */

.btic-form-section {
    margin-bottom: 15px;
}

.btic-form-section .row {
    margin: 0 -5px;
}

.btic-form-section [class*="col-"] {
    padding: 0 5px;
}

/* ==========================================================================
   Statistics Display
   ========================================================================== */

.btic-stats-section {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.btic-stats-header {
    margin-bottom: 5px;
}

.btic-stats-header label {
    font-weight: 600;
    text-align: center;
}

.btic-stat-row {
    margin-bottom: 5px;
    align-items: center;
}

.btic-stat-row .text-end {
    text-align: right;
    padding-right: 10px;
}

.btic-stat-row label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Raw Index Styling */
.btic-raw-header label,
.btic-raw-col {
    background-color: rgba(196, 215, 244, 0.65);
}

.btic-raw-input {
    background-color: #c4d7f4;
    border-color: #3974ce;
}

/* Constrained Index Styling */
.btic-constrained-header label,
.btic-constrained-col {
    background-color: rgba(188, 231, 222, 0.65);
}

.btic-constrained-input {
    background-color: #bce7de;
    border-color: #098d69;
}

/* ==========================================================================
   Constraint Controls
   ========================================================================== */

.btic-constraints-section {
    padding-top: 10px;
}

.btic-constraint-control {
    margin-bottom: 8px;
}

.btic-checkbox-label {
    display: block;
    position: relative;
    padding-left: 25px;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    margin-bottom: 3px;
    font-size: 14px;
    font-weight: 500;
}

.btic-checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.btic-checkbox-label .checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 16px;
    width: 16px;
    background-color: transparent;
    border: 2px solid #666666;
}

.btic-checkbox-label:hover input ~ .checkmark {
    background-color: #ccc;
}

.btic-checkbox-label input:checked ~ .checkmark {
    background-color: #666666;
}

.btic-checkbox-label .checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.btic-checkbox-label input:checked ~ .checkmark:after {
    display: block;
}

.btic-checkbox-label .checkmark:after {
    left: 3px;
    top: -1px;
    width: 7px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    -webkit-transform: rotate(45deg);
    -ms-transform: rotate(45deg);
    transform: rotate(45deg);
}

.btic-constraint-input[disabled] {
    background-color: #eeeeee;
    color: #a9a9a9;
}

/* ==========================================================================
   Tooltips
   ========================================================================== */

.btic-tooltip {
    display: inline-flex;
    cursor: help;
    margin-left: 3px;
}

.btic-tooltip .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    color: #666;
}

.btic-tooltip:hover .dashicons {
    color: #2271b1;
}

/* ==========================================================================
   Chart Section
   ========================================================================== */

#btic-comparison-chart {
    min-height: 250px;
}

.btic-chart-controls {
    text-align: right;
    padding: 5px 0;
}

.btic-expand-link {
    display: inline-block;
    font-size: 14px;
    color: #f2680d;
    text-decoration: none;
    cursor: pointer;
}

.btic-expand-link:hover {
    color: #c04c00;
    text-decoration: none;
}

/* Hide Highcharts credits */
.highcharts-credits {
    display: none !important;
}

/* ==========================================================================
   Data Table
   ========================================================================== */

.btic-table-wrapper {
    width: 100%;
    overflow: auto;
}

.btic-calculator table {
    font-size: 14px;
    line-height: 17px;
    text-align: center;
    margin: 0;
    width: 100%;
    border-collapse: collapse;
}

.btic-calculator table th,
.btic-calculator table td {
    border: none;
    border-right: 1px solid #f3f3f3;
    padding: 7px 10px;
    font-weight: 500;
    color: #000;
    vertical-align: middle;
}

.btic-calculator table th:last-child,
.btic-calculator table td:last-child {
    border-right: none;
}

.btic-calculator table thead th {
    font-weight: bold;
    background-color: #fff;
}

/* Column colors */
.btic-calculator table thead th:nth-child(1) {
    background-color: #fff;
}

.btic-calculator table th:nth-child(2),
.btic-calculator table th:nth-child(3),
.btic-calculator table td:nth-child(2),
.btic-calculator table td:nth-child(3) {
    background-color: rgba(196, 215, 244, 0.65);
}

.btic-calculator table th:nth-child(4),
.btic-calculator table th:nth-child(5),
.btic-calculator table td:nth-child(4),
.btic-calculator table td:nth-child(5) {
    background-color: rgba(188, 231, 222, 0.65);
}

/* Alternating rows */
.btic-calculator table tbody tr:nth-child(odd) {
    background-color: #eaeaea;
}

/* Footer styling */
.btic-calculator table tfoot tr.btic-footer-labels td {
    background-color: #fff !important;
}

.btic-calculator table tfoot tr#btic-footer-data td:nth-child(2),
.btic-calculator table tfoot tr#btic-footer-data td:nth-child(3),
.btic-calculator table tfoot tr#btic-footer-data td:nth-child(4),
.btic-calculator table tfoot tr#btic-footer-data td:nth-child(5) {
    background-color: #eaeaea;
}

/* DataTables overrides */
.btic-calculator .dataTables_wrapper .dataTables_scrollBody {
    overflow-y: auto;
}

.btic-calculator .dataTables_scrollHead,
.btic-calculator .dataTables_scrollFoot {
    overflow: hidden;
}

/* Taxed value styling */
.btic-taxed {
    color: #fb0505;
    font-weight: 600;
}

/* ==========================================================================
   Action Buttons
   ========================================================================== */

.btic-actions {
    margin: 20px 0;
}

.btic-btn-download {
    display: inline-block;
    background: linear-gradient(to right, rgba(234, 92, 21, 1) 0%, rgba(255, 123, 0, 1) 100%);
    color: #fff;
    padding: 10px 25px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 4px;
    margin: 5px;
    transition: all 0.3s ease;
}

.btic-btn-download:hover {
    background: linear-gradient(to right, rgba(200, 70, 10, 1) 0%, rgba(220, 100, 0, 1) 100%);
    color: #fff;
    text-decoration: none;
}

/* ==========================================================================
   Disclaimer
   ========================================================================== */

.btic-disclaimer {
    background-color: #f5f5f5;
    padding: 15px 20px;
    margin-top: 20px;
    border-radius: 4px;
}

.btic-disclaimer p {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: #666;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 1199px) {
    .btic-controls-column,
    .btic-table-column {
        margin-bottom: 15px;
    }
}

@media (max-width: 767px) {
    .btic-stat-row .text-end {
        text-align: left;
        margin-bottom: 5px;
    }

    .btic-stat-row [class*="col-"] {
        margin-bottom: 5px;
    }

    .btic-actions {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .btic-btn-download {
        width: 100%;
        max-width: 300px;
        text-align: center;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .btic-calculator {
        background: #fff;
    }

    .btic-btn-download,
    .btic-chart-controls {
        display: none !important;
    }

    .btic-card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }

    .btic-calculator table {
        page-break-inside: auto;
    }

    .btic-calculator table tr {
        page-break-inside: avoid;
    }
}
