/* Layout */
.ifc-calculator-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    max-width: 1000px;
    width: 100%;
    /* Ensure it takes full width of container */
    margin: 0 auto;
    font-family: 'Roboto', sans-serif;
    box-sizing: border-box;
}

.ifc-panel {
    flex: 1;
    min-width: 300px;
    padding: 2rem;
    border-radius: 1.5rem;
    box-sizing: border-box;
}

/* Left Panel (Inputs) */
.ifc-left-panel {
    background: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.ifc-header-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    color: #5e4b8b;
}

.ifc-header-row h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.ifc-input-group {
    margin-bottom: 1.25rem;
}

.ifc-input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

/* Gender Toggle */
.ifc-gender-toggle {
    display: flex;
    gap: 1rem;
    /* Removed container styles */
}

.ifc-gender-option {
    flex: 1;
    position: relative;
    cursor: pointer;
}

.ifc-gender-option input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.ifc-gender-option span {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    height: 44px;
    /* Fixed height for perfect centering */
    padding: 0 1rem;
    /* Horizontal padding only */
    border-radius: 1.5rem;
    font-weight: 600;
    color: #666;
    background: #e9e9ec;
    /* Default pill background */
    transition: all 0.3s ease;
    line-height: 1;
}

.ifc-gender-option input:checked+span {
    background: #6750a4;
    /* Primary Purple */
    color: #fff;
    box-shadow: 0 2px 5px rgba(103, 80, 164, 0.3);
}

/* Inputs - Force Material Styles */
.ifc-theme-material .ifc-input-filled {
    width: 100% !important;
    padding: 0.85rem 1rem !important;
    border: 1px solid transparent !important;
    background: #e9e9ec !important;
    /* Light gray/purple tint */
    border-radius: 0.75rem !important;
    font-size: 1rem !important;
    color: #333 !important;
    transition: background 0.2s;
    box-sizing: border-box !important;
    height: auto !important;
    line-height: 1.5 !important;
    box-shadow: none !important;
    margin: 0 !important;
}

.ifc-theme-material .ifc-input-filled:focus {
    background: #e0e0e3 !important;
    outline: none !important;
    border-color: #6750a4 !important;
}

/* Custom Select Styling to override theme defaults */
.ifc-theme-material select.ifc-input-filled {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 1rem center !important;
    background-size: 1em !important;
    padding-right: 2.5rem !important;
    /* Make room for arrow */
    cursor: pointer;
}

.ifc-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Button */
.ifc-btn-primary {
    width: 100%;
    padding: 1rem;
    background: #6750a4;
    color: #fff;
    border: none;
    border-radius: 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
    transition: transform 0.1s, box-shadow 0.2s;
}

.ifc-btn-primary:hover {
    background: #5f489a;
    box-shadow: 0 4px 12px rgba(103, 80, 164, 0.3);
}

.ifc-btn-primary:active {
    transform: scale(0.98);
}

/* Right Panel (Results) */
.ifc-right-panel {
    background: #eaddff;
    /* Light Purple Background */
    color: #21005d;
}

.ifc-protocol-header {
    margin-bottom: 2rem;
}

.ifc-subtitle {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0.7;
    margin-bottom: 0.25rem;
}

#ifc-protocol-title {
    margin: 0;
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    color: #21005d;
}

#ifc-protocol-desc {
    margin: 0.5rem 0 0;
    font-size: 1rem;
    opacity: 0.8;
}

/* Stats Grid */
.ifc-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.ifc-stat-card {
    background: rgba(255, 255, 255, 0.6);
    padding: 1rem;
    border-radius: 1rem;
}

.ifc-stat-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.6;
    margin-bottom: 0.25rem;
}

.ifc-stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.2;
}

.ifc-stat-unit {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Charts */
.ifc-charts-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.ifc-chart-card {
    background: #fff;
    padding: 1rem;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    min-width: 0;
    /* Prevent grid overflow */
}

.ifc-chart-header {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #5e4b8b;
}

.ifc-chart-wrapper {
    position: relative;
    height: 120px;
    width: 100%;
    overflow: hidden;
}

.ifc-theme-material canvas {
    max-width: 100% !important;
    height: auto !important;
}

/* Schedule */
.ifc-schedule-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 1rem;
}

.ifc-schedule-details p {
    margin: 0.5rem 0;
    font-size: 0.95rem;
}

.ifc-timer-display {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    font-weight: 700;
    color: #6750a4;
}

@media (max-width: 768px) {
    .ifc-calculator-wrapper {
        flex-direction: column;
        gap: 1rem;
        /* Reduce gap on mobile */
        padding: 0 10px;
        /* Prevent edge touching */
    }

    .ifc-grid-2,
    .ifc-stats-grid {
        grid-template-columns: 1fr;
        /* Stack grids on mobile */
    }

    .ifc-charts-row {
        grid-template-columns: 1fr;
    }

    .ifc-panel {
        min-width: 0;
        /* Allow shrinking below 300px */
        width: 100%;
        padding: 1.25rem;
        /* Reduce padding */
    }

    #ifc-protocol-title {
        font-size: 2.5rem;
        /* Smaller title on mobile */
    }
}