/* Capital Cue Calculators - Main Stylesheet */

/* CSS Variables */
:root {
    --cc-primary: #001024;
    --cc-secondary: #2a52be;
    --cc-highlight: #ffc857;
    --cc-text: #ffffff;
    --cc-text-muted: #b0b8c4;
    --cc-border-radius: 16px;
    --cc-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ===========================
   BASE STYLES - DESKTOP
   =========================== */

/* Calculator Wrapper */
.capitalcue-calculator-wrapper {
    font-family: var(--cc-font-family);
    max-width: 900px;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
    width: 100%;
}

.capitalcue-calculator-wrapper *,
.capitalcue-calculator-wrapper *::before,
.capitalcue-calculator-wrapper *::after {
    box-sizing: border-box;
}

/* Main Calculator Container - Dark Background */
.cc-calculator-container {
    background: linear-gradient(145deg, var(--cc-primary) 0%, #0a1628 100%);
    border-radius: var(--cc-border-radius);
    padding: 30px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    color: var(--cc-text);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    /* Ensure everything stays inside */
    position: relative;
    width: 100%;
}

/* Input Section */
.cc-inputs {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    min-width: 0;
    /* Flexbox overflow fix */
}

/* Calculator Heading */
.cc-inputs h3 {
    color: var(--cc-text) !important;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    padding: 0;
    text-align: left;
    line-height: 1.2;
}

/* Input Groups */
.cc-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.cc-input-group label {
    font-size: 0.9rem;
    color: var(--cc-text-muted);
    font-weight: 500;
    display: block;
}

/* Input Wrapper */
.cc-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

/* Prefix/Suffix Positioning */
.cc-prefix,
.cc-suffix {
    position: absolute;
    color: var(--cc-text-muted) !important;
    font-size: 0.95rem;
    pointer-events: none;
    z-index: 10;
}

.cc-prefix {
    left: 14px;
}

.cc-suffix {
    right: 14px;
}

/* Input Fields - FORCE DARK STYLE */
.cc-input-wrapper input[type="number"],
.cc-input-wrapper input[type="text"],
.cc-input-wrapper select {
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px 16px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 10px !important;
    color: var(--cc-text) !important;
    font-size: 1rem !important;
    font-family: inherit;
    outline: none !important;
    transition: all 0.3s ease;
    box-shadow: none !important;
    margin: 0 !important;
    height: auto !important;
    line-height: normal !important;
}

/* Adjust padding for prefix/suffix */
.cc-input-with-prefix {
    padding-left: 32px !important;
}

.cc-input-with-suffix {
    padding-right: 32px !important;
}

.cc-input-wrapper input:focus {
    border-color: var(--cc-secondary) !important;
    background: rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 0 0 3px rgba(42, 82, 190, 0.2) !important;
}

/* Range Slider */
.cc-range-slider {
    width: 100% !important;
    max-width: 100% !important;
    height: 6px !important;
    background: rgba(255, 255, 255, 0.15) !important;
    border-radius: 3px !important;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    margin: 8px 0 0 0 !important;
    padding: 0 !important;
    display: block;
    border: none !important;
}

.cc-range-slider::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
    background: var(--cc-secondary);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    appearance: none;
    -webkit-appearance: none;
    margin-top: -6px;
    /* Fix for some browsers */
}

.cc-range-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--cc-secondary);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: none;
}

/* Results Section */
.cc-results {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
}

.cc-result-item {
    margin-bottom: 20px;
}

.cc-result-label {
    font-size: 0.85rem;
    color: var(--cc-text-muted);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cc-result-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--cc-text);
}

/* Total Result Item - Special Styling */
.cc-result-total .cc-result-label {
    color: var(--cc-highlight);
    font-weight: 600;
}

.cc-result-total .cc-result-value {
    font-size: 2.2rem;
    color: var(--cc-highlight);
}

/* Chart Container */
.cc-chart-container {
    margin-top: 20px;
    height: 220px;
    position: relative;
    width: 100%;
}

/* ===================================
   MOBILE RESPONSIVE (max-width: 768px)
   =================================== */
@media (max-width: 768px) {
    .capitalcue-calculator-wrapper {
        padding: 0 10px;
    }

    .cc-calculator-container {
        grid-template-columns: 1fr;
        padding: 24px 20px;
        gap: 24px;
        border-radius: 16px;
    }

    /* Heading - Centered */
    .cc-inputs h3 {
        text-align: center;
        margin-bottom: 12px;
    }

    /* Results */
    .cc-results {
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.06);
        text-align: center;
    }

    .cc-result-item {
        text-align: center;
    }

    .cc-result-total {
        margin-top: 10px;
        padding-top: 15px;
        border-top: 1px solid rgba(255, 200, 87, 0.2);
    }

    .cc-result-total .cc-result-value {
        font-size: 1.8rem;
    }
}

/* ===================================
   MOBILE PHONE (max-width: 480px)
   =================================== */
@media (max-width: 480px) {
    .capitalcue-calculator-wrapper {
        padding: 0 5px;
    }

    .cc-calculator-container {
        padding: 20px 15px;
        gap: 20px;
        border-radius: 14px;
    }

    .cc-inputs {
        gap: 18px;
    }

    .cc-inputs h3 {
        font-size: 1.35rem;
    }

    .cc-input-group {
        gap: 6px;
    }

    .cc-input-wrapper input,
    .cc-input-wrapper select {
        padding: 14px 14px !important;
        /* Adjust default padding */
    }

    /* Re-apply conditional padding for mobile */
    .cc-input-with-prefix {
        padding-left: 32px !important;
    }

    .cc-input-with-suffix {
        padding-right: 32px !important;
    }

    .cc-range-slider {
        margin-top: 12px !important;
    }
}