/* 
 * Bluegate Calculators - Modern CBM Styles
 * Highly specific selectors to prevent WordPress theme conflicts
 */

.bg-modern-calc.bg-cbm-calc {
    font-family: var(--e-global-typography-primary-font-family), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1f2937;
    max-width: 800px;
    margin: 2rem auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    line-height: 1.5;
    background: #ffffff;
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
}

.bg-modern-calc.bg-cbm-calc *,
.bg-modern-calc.bg-cbm-calc *::before,
.bg-modern-calc.bg-cbm-calc *::after {
    box-sizing: border-box;
}

/* Header */
.bg-modern-calc .bg-mc-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #f3f4f6;
    margin: 0;
}

.bg-modern-calc .bg-mc-icon {
    color: #3b82f6;
    width: 28px;
    height: 28px;
}

.bg-modern-calc .bg-mc-header h3 {
    margin: 0;
    padding: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    border: none;
    line-height: 1.2;
}

/* Body and Layout */
.bg-modern-calc .bg-mc-intro {
    background: #f9fafb;
    padding: 1.5rem;
    border-radius: 0.5rem;
    border-left: 4px solid #3b82f6;
}

.bg-modern-calc .bg-mc-intro p {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.bg-modern-calc .bg-mc-intro ul {
    margin-top: 0;
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
}

.bg-modern-calc .bg-mc-body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.bg-modern-calc .bg-mc-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.bg-modern-calc .bg-mc-dimensions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 600px) {
    .bg-modern-calc .bg-mc-row {
        grid-template-columns: 1fr 1fr;
    }
    .bg-modern-calc .bg-mc-dimensions {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Field Groups and Inputs */
.bg-modern-calc .bg-mc-field-group {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 56px;
    margin: 0;
    padding: 0;
}

.bg-modern-calc input.bg-mc-input,
.bg-modern-calc select.bg-mc-input {
    width: 100%;
    height: 56px;
    border: 1px solid #d1d5db !important;
    background-color: #f9fafb !important;
    padding: 1.5rem 1rem 0.5rem 1rem !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    color: #111827 !important;
    font-family: inherit !important;
    outline: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    border-radius: 0.5rem !important;
    margin: 0 !important;
    line-height: normal !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
    transition: all 0.2s ease;
}

.bg-modern-calc input.bg-mc-input:focus,
.bg-modern-calc select.bg-mc-input:focus {
    border-color: #3b82f6 !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important;
}

.bg-modern-calc select.bg-mc-input {
    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='%236b7280' 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: 1.2em !important;
    padding-right: 2.5rem !important;
    padding-top: 1.5rem !important;
    padding-bottom: 0.5rem !important;
}

.bg-modern-calc label.bg-mc-label-floating,
.bg-modern-calc label.bg-mc-label-static {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    font-weight: 500;
    color: #6b7280;
    margin: 0;
    padding: 0;
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

.bg-modern-calc label.bg-mc-label-static {
    top: 0.75rem;
    transform: translateY(0);
    font-size: 0.75rem;
    font-weight: 600;
}

/* Floating label trigger */
.bg-modern-calc .bg-mc-input:focus ~ .bg-mc-label-floating,
.bg-modern-calc .bg-mc-input:not(:placeholder-shown) ~ .bg-mc-label-floating,
.bg-modern-calc .bg-mc-field-group.has-value .bg-mc-label-floating {
    top: 0.75rem;
    transform: translateY(0);
    font-size: 0.75rem;
    font-weight: 600;
    color: #3b82f6;
}

.bg-modern-calc .bg-mc-input:not(:focus):not(:placeholder-shown) ~ .bg-mc-label-floating,
.bg-modern-calc .bg-mc-field-group.has-value:not(:focus-within) .bg-mc-label-floating {
    color: #6b7280;
}

.bg-modern-calc .bg-mc-has-suffix {
    padding-right: 3rem !important;
}

.bg-modern-calc .bg-mc-suffix {
    position: absolute;
    right: 1rem;
    bottom: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    pointer-events: none;
    margin: 0;
    z-index: 2;
}

/* Hide number input spinners */
.bg-modern-calc .bg-mc-input[type="number"]::-webkit-inner-spin-button,
.bg-modern-calc .bg-mc-input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.bg-modern-calc .bg-mc-input[type="number"] {
    -moz-appearance: textfield;
}

/* Results Section */
.bg-modern-calc .bg-mc-results {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 2px solid #f3f4f6;
    margin: 0;
}

@media (min-width: 600px) {
    .bg-modern-calc .bg-mc-results {
        grid-template-columns: repeat(2, 1fr);
    }
}

.bg-modern-calc .bg-mc-result-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: 0.75rem;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin: 0;
}

.bg-modern-calc .bg-mc-result-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.bg-modern-calc .bg-mc-result-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #4b5563;
    margin: 0;
    flex-shrink: 0;
}

.bg-modern-calc .bg-mc-highlight {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.bg-modern-calc .bg-mc-highlight .bg-mc-result-icon {
    background: #dbeafe;
    color: #2563eb;
}

.bg-modern-calc .bg-mc-result-content {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    margin: 0;
}

.bg-modern-calc .bg-mc-result-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
    line-height: 1.2;
}

.bg-modern-calc .bg-mc-highlight .bg-mc-result-title {
    color: #1e40af;
}

.bg-modern-calc .bg-mc-result-val {
    font-size: 2rem;
    font-weight: 800;
    color: #111827;
    line-height: 1;
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    margin: 0;
}

.bg-modern-calc .bg-mc-highlight .bg-mc-result-val {
    color: #1d4ed8;
}

.bg-modern-calc .bg-mc-result-val small {
    font-size: 1rem;
    font-weight: 600;
    color: #6b7280;
    margin: 0;
}

.bg-modern-calc .bg-mc-highlight .bg-mc-result-val small {
    color: #3b82f6;
}

/* Animations */
@keyframes bg-value-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.bg-modern-calc .bg-value-updated {
    animation: bg-value-pop 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
