.tco-calculator-section {
    padding: 60px 0;
    background-color: #000000;
    /* Pure Black section background */
    perspective: 1000px;
    /* Perspective for 3D tilt */
}

.tco-calculator-container {
    display: flex;
    flex-wrap: wrap;
    background-image: url('section-bg.webp');
    /* Product card background with lines */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 32px;
    /* Matches .showcase */
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    /* Gradient Border Logic */
    border: 1px solid transparent;
    background-clip: padding-box, border-box;
    background-origin: padding-box, border-box;
    /* Fallback background + Gradient Border */
    background-image: linear-gradient(#1e1e1e, #1e1e1e), linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));

    transition: box-shadow 0.3s ease;
    /* Only animate shadow, transform handled by JS */
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    transform-style: preserve-3d;
    /* Enable 3D space */
    will-change: transform;
    /* Optimize for animation */
}

/* Re-apply the background image on top of the gradient border hack, or use a pseudo-element for the image */
.tco-calculator-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('section-bg.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.6;
    /* Adjust opacity to blend with dark background */
    z-index: -1;
    /* Behind content */
    pointer-events: none;
}

/* Ensure content is above the pseudo-element */
.tco-sidebar,
.tco-main {
    z-index: 1;
}

.tco-calculator-container:hover {
    /* Transform handled by JS for tilt effect */
    box-shadow: 0 40px 80px rgba(91, 19, 156, 0.15);
    /* Subtle purple glow on hover */
}

.tco-sidebar {
    flex: 1;
    min-width: 300px;
    background: rgba(21, 21, 21, 0.7);
    /* Slightly more opaque for contrast */
    padding: 30px;
    /* Reduced padding */
    display: flex;
    flex-direction: column;
    gap: 15px;
    /* Reduced gap */
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
}

.tco-main {
    flex: 2;
    min-width: 400px;
    padding: 30px;
    /* Reduced padding */
    display: flex;
    flex-direction: column;
    gap: 20px;
    /* Reduced gap */
    background: rgba(0, 0, 0, 0.3);
    /* Darker main area */
}

.tco-title {
    font-size: 1.5rem;
    /* Smaller title */
    font-weight: 700;
    margin-bottom: 10px;
    color: #fff;
}

.tco-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    /* Reduced gap */
}

.tco-label {
    font-size: 0.85rem;
    /* Smaller label */
    color: #aaa;
    font-weight: 500;
}

/* Compact Input Group: Input + Slider side-by-side */
.tco-input-group {
    display: flex;
    flex-direction: row;
    /* Side-by-side */
    align-items: center;
    gap: 10px;
}

.tco-input {
    background: rgba(42, 42, 42, 0.6);
    border: 1px solid #444;
    color: #fff;
    padding: 8px;
    /* Compact padding */
    border-radius: 8px;
    font-size: 0.9rem;
    width: 80px;
    /* Fixed width for compactness */
    text-align: center;
}

/* Custom Slider Styling */
.tco-slider {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    /* Take remaining space */
    max-width: 150px;
    /* Limit width as requested (1.5-2x shorter) */
    height: 4px;
    /* Thinner track */
    background: rgba(68, 68, 68, 0.6);
    border-radius: 2px;
    outline: none;
    transition: background 0.3s;
    cursor: pointer;
}

.tco-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    /* Smaller thumb */
    height: 14px;
    background: #5b139c;
    /* Kvazar Purple */
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
    border: 2px solid #1e1e1e;
    /* Ring effect */
}

.tco-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.tco-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #5b139c;
    /* Kvazar Purple */
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
    border: 2px solid #1e1e1e;
}

.tco-result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.tco-result-title {
    font-size: 1.1rem;
    /* Smaller result title */
    color: #fff;
    max-width: 60%;
    line-height: 1.4;
    opacity: 0.9;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.btn-tco {
    background: #5b139c;
    /* Kvazar Purple */
    color: #fff;
    padding: 12px 24px;
    /* Standard button padding */
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.3s, transform 0.2s;
    display: inline-block;
    text-align: center;
    box-shadow: 0 4px 15px rgba(91, 19, 156, 0.4);
    /* Purple glow */
}

.btn-tco:hover {
    background: #7c30c7;
    /* Lighter purple on hover */
    transform: translateY(-2px);
    color: #fff;
    box-shadow: 0 6px 20px rgba(91, 19, 156, 0.6);
}

.tco-total-savings {
    font-size: 2.2rem;
    /* Compact total */
    font-weight: 800;
    color: #fff;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.tco-total-label {
    font-size: 0.85rem;
    color: #ccc;
    margin-bottom: 20px;
}

.tco-metrics {
    display: flex;
    flex-direction: column;
    gap: 15px;
    /* Reduced gap */
}

.tco-metrics-row {
    display: flex;
    gap: 15px;
    /* Reduced gap */
}

.tco-metric {
    flex: 1;
    background: rgba(37, 37, 37, 0.4);
    /* More transparent metric card */
    padding: 15px;
    /* Compact metric card */
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
    backdrop-filter: blur(5px);
}

.tco-chart {
    width: 36px;
    /* Smaller chart */
    height: 36px;
    border-radius: 50%;
    background: conic-gradient(#5b139c 0% 0%, #333 0% 100%);
    /* Default purple */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    position: relative;
}

.tco-chart::before {
    content: '';
    position: absolute;
    width: 28px;
    /* Inner circle */
    height: 28px;
    background: #252525;
    border-radius: 50%;
}

.tco-chart-value {
    position: relative;
    z-index: 1;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
}

.tco-metric-value {
    font-size: 1.1rem;
    /* Smaller metric value */
    font-weight: 700;
    color: #fff;
    margin-bottom: 3px;
}

.tco-metric-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #ccc;
    margin-bottom: 5px;
}

.tco-metric-desc {
    font-size: 0.7rem;
    color: #aaa;
    line-height: 1.3;
}

@media (max-width: 992px) {
    .tco-calculator-container {
        flex-direction: column;
    }

    .tco-sidebar {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .tco-metrics-row {
        flex-direction: column;
    }
}