/* NikWorth Integrated Calculator Styles (Dark Mode) */

/* Use NikWorth Global Variables where possible, define specific overrides here */
:root {
    /* Mapping to NikWorth variables based on analysis */
    /* --primary-color: #FDE5D4; (Beige/Cream) -> Use for Headings/Highlights */
    /* --secondary-color: #1B1B1B; (Dark Grey) -> Use for Card Backgrounds */
    /* --accent-color: #A6B28B; (Sage Green) -> Use for Buttons/Accents */
    /* --text-color: #F5F5F4; (Off-white) -> Main Text */

    --calc-card-bg: #1B1B1B;
    /* Match secondary */
    --calc-input-bg: rgba(255, 255, 255, 0.05);
    --calc-border: rgba(255, 255, 255, 0.1);
}

.calculator-section {
    padding: 120px 0 80px;
    background-color: var(--dark-color);
    /* Maintain dark theme */
    color: var(--text-color);
}

.calculator-card {
    background: var(--calc-card-bg);
    border: 1px solid var(--calc-border);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.calculator-card.bg-light {
    background: #252525 !important;
    /* Override light bg for dark mode relevance */
    color: var(--text-color) !important;
}

.calculator-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-5px);
}

/* Headings */
.section-title h2 span {
    color: var(--accent-color);
}

.calc-header,
.section-title-calc,
.section-header,
.section-header-calc {
    color: var(--primary-color);
    border-bottom: 1px solid var(--accent-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 1rem;
}

.section-header-calc {
    background: transparent;
    padding-left: 0;
    border-left: none;
    border-bottom: 1px solid var(--accent-color);
}


/* Inputs */
.form-label,
label {
    color: rgba(255, 255, 255, 0.7);
    font-family: var(--default-font);
    font-weight: 500;
}

.form-control,
.input-group-text {
    background-color: var(--calc-input-bg);
    border: 1px solid var(--calc-border);
    color: #fff;
    font-family: var(--default-font);
}

.form-control:focus {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-color);
    color: #fff;
    box-shadow: none;
}

.input-group-text {
    border-right: none;
    color: var(--accent-color);
}

.form-control {
    border-left: none;
    text-align: right;
}

/* Results */
.text-primary {
    color: var(--primary-color) !important;
}

/* Beige */
.text-success {
    color: var(--accent-color) !important;
}

/* Sage Green */
.text-danger {
    color: #ff6b6b !important;
}

.text-warning {
    color: #fcc419 !important;
}

.text-dark {
    color: #fff !important;
}

/* Invert dark text to white */
.text-muted {
    color: rgba(255, 255, 255, 0.5) !important;
}

.result-box {
    background: rgba(166, 178, 139, 0.1);
    /* Accent tint */
    border: 1px solid var(--accent-color);
    border-radius: 10px;
}

/* Tables */
.table {
    color: var(--text-color);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--calc-border);
}

.table th {
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    border-bottom: 1px solid var(--calc-border);
}

.table td {
    vertical-align: middle;
}

.comparison-table tr:last-child {
    border-top: 1px solid var(--accent-color);
    color: var(--primary-color);
}

/* Specific Adjustments */
.limit-card {
    background-color: var(--calc-input-bg);
    color: var(--text-color);
    border: 1px solid var(--calc-border);
}

.total-row {
    background-color: rgba(166, 178, 139, 0.2);
    /* Accent tint */
    color: var(--primary-color);
}

.impact-card {
    background-color: rgba(166, 178, 139, 0.15) !important;
    color: var(--text-color) !important;
    border: 1px solid var(--accent-color);
}

/* Buttons */
.btn-default {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.btn-default:hover {
    background: var(--accent-color);
    color: var(--dark-color);
}

.badge {
    font-weight: 500;
}

.badge.bg-warning {
    background-color: #fcc419 !important;
    color: #000 !important;
}

.badge.bg-secondary {
    background-color: rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
}

.badge.bg-dark {
    background-color: #000 !important;
    border: 1px solid var(--calc-border);
}

/* Trap Warning */
.trap-warning {
    background-color: rgba(255, 107, 107, 0.2);
    border: 1px solid #ff6b6b;
    color: #ff6b6b;
}

/* Custom Range Slider */
input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
    margin: 10px 0;
}

input[type=range]:focus {
    outline: none;
}

/* Webkit (Chrome, Safari, Edge) */
input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    border: 0;
}

input[type=range]::-webkit-slider-thumb {
    border: 1px solid var(--accent-color);
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: var(--dark-color, #000);
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -7px;
    /* (height - track_height) / 2 */
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    transition: background 0.2s, transform 0.2s;
}

input[type=range]::-webkit-slider-thumb:hover {
    background: var(--accent-color);
    transform: scale(1.1);
}

/* Firefox */
input[type=range]::-moz-range-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    border: 0;
}

input[type=range]::-moz-range-thumb {
    border: 1px solid var(--accent-color);
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: var(--dark-color, #000);
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    transition: background 0.2s, transform 0.2s;
}

input[type=range]::-moz-range-thumb:hover {
    background: var(--accent-color);
    transform: scale(1.1);
}

/* Floating Dock Navigation */
.calculator-dock {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    z-index: 1000;
    background: rgba(20, 20, 20, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 15px 10px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.dock-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.dock-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    /* Bouncy transition */
    font-size: 1.1rem;
    border: 1px solid transparent;
    position: relative;
}

/* Base Hover */
.dock-link:hover {
    transform: scale(1.15);
}

/* --- Specific Tool Colors (Matching Index) --- */

/* Gap: Sage Green (Accent) */
.dock-btn-gap:hover,
.dock-link.active i {
    color: var(--accent-color);
    text-shadow: 0 0 10px var(--accent-color);
}

/* Quick Access Pills */
.quick-access-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    padding: 6px 16px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
}

.quick-access-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
    transform: translateY(-2px);
}

.quick-access-pill.active {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent-color);
    color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.dock-btn-gap.active {
    color: var(--accent-color);
    border-color: var(--accent-color);
    background: rgba(166, 178, 139, 0.2);
    box-shadow: 0 0 15px rgba(166, 178, 139, 0.4);
}

/* Savings: Yellow (Warning) */
.dock-btn-savings:hover,
.dock-btn-savings.active {
    color: #fcc419;
    border-color: #fcc419;
    background: rgba(252, 196, 25, 0.2);
    box-shadow: 0 0 15px rgba(252, 196, 25, 0.4);
}

/* Upgrades: Red (Danger) */
.dock-btn-upgrades:hover,
.dock-btn-upgrades.active {
    color: #ff6b6b;
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.2);
    box-shadow: 0 0 15px rgba(255, 107, 107, 0.4);
}

/* Bonus: Blue (Primary) */
.dock-btn-bonus:hover,
.dock-btn-bonus.active {
    color: #0d6efd;
    border-color: #0d6efd;
    background: rgba(13, 110, 253, 0.2);
    box-shadow: 0 0 15px rgba(13, 110, 253, 0.4);
}

/* Emergency: Red (Danger/Protection) */
.dock-btn-emergency:hover,
.dock-btn-emergency.active {
    color: #ff6b6b;
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.2);
    box-shadow: 0 0 15px rgba(255, 107, 107, 0.4);
}

/* All Tools (Secondary) */
.dock-link.secondary:hover {
    color: #fff;
    border-color: #fff;
    background: rgba(255, 255, 255, 0.2);
}

.dock-divider {
    width: 20px;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    margin: 5px 0;
}

/* Tooltip Customization (Custom CSS Label) */
.dock-label {
    position: absolute;
    right: 60px;
    /* Position to the left of the dock */
    top: 50%;
    transform: translateY(-50%) translateX(10px);
    background: #000;
    color: #fff;
    padding: 5px 12px;
    border-radius: 5px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dock-link:hover .dock-label {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

/* Tooltip Colors matching buttons */
.dock-btn-gap .dock-label {
    background: var(--accent-color);
    color: #000;
}

.dock-btn-savings .dock-label {
    background: #fcc419;
    color: #000;
}

.dock-btn-upgrades .dock-label {
    background: #ff6b6b;
    color: #fff;
}

.dock-btn-bonus .dock-label {
    background: #0d6efd;
    color: #fff;
}

.dock-btn-emergency .dock-label {
    background: #ff6b6b;
    color: #fff;
}

.dock-link.secondary .dock-label {
    background: #fff;
    color: #000;
}

/* Tooltip Arrow */
.dock-label::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -5px;
    transform: translateY(-50%);
    border-width: 5px 0 5px 5px;
    border-style: solid;
    border-color: transparent transparent transparent transparent;
}

/* Arrow Colors */
.dock-btn-gap .dock-label::after {
    border-left-color: var(--accent-color);
}

.dock-btn-savings .dock-label::after {
    border-left-color: #fcc419;
}

.dock-btn-upgrades .dock-label::after {
    border-left-color: #ff6b6b;
}

.dock-btn-bonus .dock-label::after {
    border-left-color: #0d6efd;
}

.dock-btn-emergency .dock-label::after {
    border-left-color: #ff6b6b;
}

.dock-link.secondary .dock-label::after {
    border-left-color: #fff;
}

/* Tooltip Customization (Bootstrap Override if needed) */
.tooltip-inner {
    background-color: #222;
    /* Darker bg */
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 500;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    padding: 8px 12px;
}

.tooltip.bs-tooltip-start .tooltip-arrow::before {
    border-left-color: #222;
}

/* Executive A4 Letterhead Template (Formal Document Design) */
.pdf-report-document {
    background: #ffffff !important;
    color: #111111 !important;
    padding: 2.5cm 1.5cm !important;
    /* Standard Margin for Letterhead */
    font-family: 'Inter', -apple-system, sans-serif !important;
    line-height: 1.6;
    display: none;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
    border-bottom: 2px solid #A6B28B;
    padding-bottom: 20px;
}

.report-header .company-logo img {
    height: 80px;
    filter: none !important;
    /* Ensure logo is clear on white */
}

.report-header .company-details {
    text-align: right;
    font-size: 10px;
    color: #444;
}

.report-header .company-details h5 {
    color: #111;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 5px;
}

.report-title-section {
    margin-bottom: 40px;
    text-align: left;
}

.report-title-section h1 {
    font-size: 24px;
    font-weight: 800;
    color: #111;
    margin-bottom: 5px;
    letter-spacing: -0.5px;
}

.report-title-section .report-meta {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.report-section {
    margin-bottom: 30px;
}

.report-section-title {
    font-size: 13px;
    font-weight: 700;
    background: #f8f9fa;
    padding: 10px 15px;
    border-left: 5px solid #A6B28B;
    margin-bottom: 15px;
    text-transform: uppercase;
    color: #333;
}

/* Formal Table for Report */
.report-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 25px;
}

.report-table th,
.report-table td {
    padding: 12px 15px;
    border-bottom: 1px dotted #ddd;
    text-align: left;
    font-size: 13px;
    color: #333;
}

.report-table th {
    font-weight: 600;
    color: #666;
    background: #fafafa;
    border-bottom: 1px solid #ccc;
}

.report-table td.value-cell {
    font-weight: 700;
    text-align: right;
    color: #111;
}

/* High-Impact Insight Boxes */
.report-insight-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 25px 0;
}

.report-insight-item {
    background: #fff;
    border: 1px solid #eee;
    padding: 20px;
    text-align: center;
    border-radius: 4px;
}

.report-insight-item label {
    display: block;
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.report-insight-item .value {
    font-size: 20px;
    font-weight: 800;
    color: #A6B28B;
}

.report-footer {
    margin-top: 80px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    font-size: 9px;
    color: #999;
}

.report-footer .footer-layout {
    display: flex;
    justify-content: space-between;
}

.report-disclaimer {
    max-width: 80%;
    font-style: italic;
    line-height: 1.4;
}

/* Progress bar for PDF */
.pdf-progress-track {
    width: 100%;
    height: 10px;
    background: #eee;
    border-radius: 5px;
    margin: 10px 0;
    overflow: hidden;
}

.pdf-progress-bar {
    height: 100%;
    background: #A6B28B;
}

/* Quick Access Dropdown Styling */
.dropdown-menu-dark .dropdown-item {
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.dropdown-menu-dark .dropdown-item:hover {
    background: rgba(166, 178, 139, 0.15);
    color: var(--accent-color);
    padding-left: 25px;
}

.dropdown-menu-dark .dropdown-item.active {
    background: var(--accent-color);
    color: var(--dark-color) !important;
}

.dropdown-menu-dark .dropdown-item.active i {
    color: var(--dark-color) !important;
}

.btn-outline-accent {
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    background: rgba(166, 178, 139, 0.05);
    transition: all 0.3s ease;
}

.btn-outline-accent:hover,
.btn-outline-accent:focus,
.show>.btn-outline-accent.dropdown-toggle {
    background: var(--accent-color);
    color: var(--dark-color);
    border-color: var(--accent-color);
}