/* Apple-inspired dark mode calculator styles */
.calculator-section {
    background-color: #000;
    color: #fff;
    padding: 5rem 0;
    position: relative;
    overflow: hidden;
}

.calculator-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 30%, rgba(103, 58, 183, 0.05), transparent 40%),
                radial-gradient(circle at 70% 60%, rgba(25, 118, 210, 0.05), transparent 40%);
    z-index: 0;
}

.calculator-section .container {
    position: relative;
    z-index: 1;
}

.calculator-section h2 {
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 1rem;
    font-size: 2.5rem;
    background: linear-gradient(90deg, #fff, #bbb);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.calculator-section .lead {
    color: #86868b;
    max-width: 600px;
    margin: 0 auto 2rem;
    font-weight: 400;
}

/* Cards */
.apple-card {
    background: rgba(30, 30, 32, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
                box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.apple-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

/* Form Controls */
.apple-input-group {
    margin-bottom: 1.75rem;
    position: relative;
}

.apple-input-label {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #fff;
    display: block;
}

.apple-input-description {
    font-size: 0.8rem;
    color: #86868b;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.apple-input-wrapper {
    position: relative;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
    overflow: hidden;
}

.apple-input-wrapper:focus-within {
    border-color: #0071e3;
    box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.3);
}

.apple-input-wrapper input {
    width: 100%;
    background: transparent;
    border: none;
    padding: 0.9rem 4.5rem 0.9rem 1rem;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 500;
    -webkit-appearance: none;
    appearance: none;
}

.apple-input-wrapper input:focus {
    outline: none;
}

.apple-input-wrapper input::-webkit-inner-spin-button,
.apple-input-wrapper input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.apple-input-unit {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #86868b;
    font-size: 0.95rem;
    font-weight: 400;
    pointer-events: none;
}

/* Apple-style Slider */
.apple-slider-container {
    padding: 0.5rem 0 1.5rem;
}

.apple-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
}

.apple-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
}

.apple-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.apple-slider-values {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #86868b;
}

/* Results */
.apple-results {
    margin-top: 0;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.apple-results-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: rgba(30, 30, 32, 0.8);
    position: relative;
    overflow: hidden;
}

.apple-results-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 50%);
    z-index: 0;
    pointer-events: none;
}

.results-header {
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 1.5rem;
    letter-spacing: -0.5px;
    background: linear-gradient(90deg, #fff, #bbb);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    z-index: 1;
}

.cost-comparison {
    margin-bottom: 1.5rem;
}

.cost-item {
    margin-bottom: 1.75rem;
    position: relative;
}

.cost-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.cost-label span:first-child {
    font-size: 0.95rem;
    color: #fff;
    letter-spacing: -0.25px;
    font-weight: 400;
}

.cost-label span:last-child {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.5px;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.satellite-cost .cost-label span:last-child {
    color: #ff375f;
}

.amtecco-cost .cost-label span:last-child {
    color: #0071e3;
}

.apple-bar-container {
    height: 10px;
    background: rgba(30, 30, 32, 0.5);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
    margin-bottom: 1.5rem;
}

.apple-bar {
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 5px;
    transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.satellite-bar {
    background: linear-gradient(90deg, #ff2d55, #ff375f);
    background-size: 200% 100%;
    animation: shimmerBar 2s infinite linear;
}

.amtecco-bar {
    background: linear-gradient(90deg, #0071e3, #42a5f5);
    background-size: 200% 100%;
    animation: shimmerBar 2s infinite linear;
}

@keyframes shimmerBar {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: -100% 0;
    }
}

/* Savings Metrics */
.savings-metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 1fr; /* Force rows to be equal height */
    gap: 1rem;
    margin-top: 1.5rem;
    width: 100%;
}

.apple-metric {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 1.25rem 1rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    height: 100%; /* Ensure full height */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.apple-metric::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 70%);
    z-index: 0;
    pointer-events: none;
}

.apple-metric:hover {
    transform: translateY(-5px) scale(1.02);
    background-color: rgba(0, 0, 0, 0.3);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.15);
}

.metric-label {
    font-size: 0.8rem;
    color: #86868b;
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    position: relative;
    z-index: 1;
    min-height: 1.2em; /* Ensure consistent height */
    width: 100%;
}

.metric-value {
    font-size: 1.6rem;
    font-weight: 600;
    color: #fff;
    display: block;
    margin-bottom: 0.25rem;
    letter-spacing: -0.5px;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    width: 100%;
}

.metric-percentage {
    font-size: 0.9rem;
    font-weight: 500;
    color: #2ecc71;
    margin-left: 0.5rem;
    position: relative;
    z-index: 1;
    width: 100%;
}

.savings-metric .metric-value {
    color: #2ecc71;
}

.current-spend-metric .metric-value {
    color: #ff375f;
}

/* Pricing Info */
.pricing-info {
    margin-top: auto;
    padding-top: 1.5rem;
    font-size: 0.85rem;
    color: #86868b;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    line-height: 1.5;
    position: relative;
    padding: 1.5rem 1rem 0.5rem;
}

.pricing-info::before {
    content: '';
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
}

.pricing-info i {
    color: rgba(0, 113, 227, 0.8);
    margin-right: 6px;
}

.pricing-value {
    color: #fff;
    font-weight: 500;
    display: inline-block;
    border-bottom: 1px dotted rgba(255, 255, 255, 0.3);
}

.pricing-value {
    color: #fff;
    font-weight: 500;
}

/* Animation improvements */
.savings-metric {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 113, 227, 0.3);
}

.savings-metric::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        rgba(0, 113, 227, 0), 
        rgba(0, 113, 227, 0.1), 
        rgba(0, 113, 227, 0));
    transform: translateX(-100%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

/* Dark Mode Chart Overrides */
#savingsChart {
    --chart-background: transparent;
    --chart-grid-color: rgba(255, 255, 255, 0.1);
    --chart-text-color: rgba(255, 255, 255, 0.6);
}

/* Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes highlight {
    0% { text-shadow: 0 0 0 rgba(46, 204, 113, 0); }
    50% { text-shadow: 0 0 10px rgba(46, 204, 113, 0.5); }
    100% { text-shadow: 0 0 0 rgba(46, 204, 113, 0); }
}

.metric-percentage.highlight {
    animation: highlight 1s ease-out;
}

.apple-input-group,
.cost-item,
.apple-metric {
    animation: slideUp 0.5s ease forwards;
    opacity: 0;
}

.apple-input-group:nth-child(1) { animation-delay: 0.1s; }
.apple-input-group:nth-child(2) { animation-delay: 0.2s; }
.apple-input-group:nth-child(3) { animation-delay: 0.3s; }
.cost-item:nth-child(1) { animation-delay: 0.4s; }
.cost-item:nth-child(2) { animation-delay: 0.5s; }
.apple-metric:nth-child(1) { animation-delay: 0.6s; }
.apple-metric:nth-child(2) { animation-delay: 0.7s; }
.apple-metric:nth-child(3) { animation-delay: 0.8s; }
.apple-metric:nth-child(4) { animation-delay: 0.9s; }

/* Responsive Styles */
@media (max-width: 992px) {
    .apple-card {
        margin-bottom: 2rem;
    }
    
    .savings-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 1fr; /* Maintain equal height on tablets */
    }
}

@media (max-width: 767px) {
    .row.align-items-stretch > .col-lg-6 {
        width: 100%; /* Force columns to be full width on mobile */
    }
    
    .apple-card {
        margin-bottom: 1.5rem;
        width: 100%; /* Ensure cards are full width */
    }
    
    .calculator-section h2 {
        font-size: 2rem;
    }
    
    .savings-metrics-grid {
        grid-template-columns: repeat(1, 1fr); /* Stack metrics vertically on mobile */
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    /* Ensure both cards have same styling on mobile */
    .apple-results-card, 
    .calculator-inputs {
        width: 100%;
    }
    
    .calculator-row {
        display: flex;
        flex-wrap: wrap;
    }

    .calculator-input-column,
    .calculator-results-column {
        display: flex;
        width: 100%;
    }

    .w-100 {
        width: 100%;
    }

    .calculator-input-column,
    .calculator-results-column {
        width: 100%;
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Force equal card heights */
    .apple-card {
        height: auto !important; /* Override any JS-set heights */
    }
    
    /* Maintain spacing between stacked cards */
    .calculator-input-column {
        margin-bottom: 1.5rem;
    }
    
    /* Make cost comparison bars more visible on mobile */
    .apple-bar-container {
        height: 12px;
        margin-bottom: 1.75rem;
    }
    
    /* Make the calculator section padding smaller on mobile */
    .calculator-section {
        padding: 3rem 0;
    }
    
    /* Ensure the results header is visually consistent */
    .results-header {
        font-size: 1.3rem;
        margin-bottom: 1.25rem;
    }
    
    /* Better mobile experience for metric cards */
    .savings-metrics-grid {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .apple-metric {
        height: auto !important;
        margin-bottom: 0.75rem;
        transform: none !important;
        transition: background-color 0.3s ease, border-color 0.3s ease;
    }
    
    .apple-metric:hover {
        transform: none !important;
        background-color: rgba(0, 0, 0, 0.25);
    }
    
    .metric-value {
        font-size: 1.4rem;
        margin-bottom: 0.25rem;
    }
    
    .metric-label {
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }
    
    .metric-percentage {
        font-size: 0.85rem;
    }
    
    /* Ensure results header looks good */
    .results-header {
        text-align: center;
        margin-bottom: 1.5rem;
        font-size: 1.4rem;
    }
    
    /* Make cost comparison more compact on mobile */
    .cost-comparison {
        margin-bottom: 1rem;
    }
    
    .cost-item {
        margin-bottom: 1.25rem;
    }
}

/* Add a smooth transition for the layout changes */
.calculator-input-column,
.calculator-results-column,
.apple-card {
    transition: width 0.3s ease, height 0.3s ease, margin 0.3s ease;
}
