/* Wedding Budget Calculator Styles */
/* Prefix: wbc- */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

body {
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.wbc-body {
    width: 100%;
    box-sizing: border-box;
}

/* CMS compatibility - Force wide layout */
.c-matter--article .c-matter__body {
    max-width: 1170px !important;
    width: 100% !important;
}

.ci-body {
    width: 100%;
    max-width: 1170px;
    margin: 0 auto;
}

@media(min-width: 992px) {
    .c-matter--article .c-matter__body:has(.ci-body) {
        max-width: 1170px !important;
        width: auto !important;
    }
}

.c-matter--article .wbc-body,
.c-matter--article .wbc-container {
    max-width: 1170px !important;
    width: 100% !important;
}

@media (max-width: 950px) {
    .c-matter--article .c-matter__body {
        max-width: 750px !important;
        padding: 1.5rem;
    }
}

@media (max-width: 750px) {
    .c-matter--article .c-matter__body {
        max-width: 100% !important;
        margin: 10px;
        padding: 1rem;
        border-radius: 8px;
    }
}

/* Container and layout */
.wbc-container {
    max-width: 1170px;
    margin: 2rem auto 4rem auto;
    padding: 0 2rem;
    background: transparent;
    box-sizing: border-box;
}

/* Two-column layout */
.wbc-calculator-layout {
    display: grid !important;
    grid-template-columns: 0.48fr 0.52fr;
    gap: 24px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
    align-items: start !important;
}

.c-matter--article .wbc-calculator-layout {
    display: grid !important;
    grid-template-columns: 0.48fr 0.52fr;
    gap: 24px !important;
}

.wbc-form-column {
    background: #f7fafc;
    border: 2px solid #f3f4f6;
    border-radius: var(--radius-lg);
    padding: 26px;
    margin-bottom: 24px;
    min-width: 0;
    max-width: 100%;
    overflow: visible;
    height: fit-content;
    transform: translateZ(0);
    will-change: transform;
}

/* Sticky positioning - desktop only */
@media (min-width: 751px) {
    .wbc-form-column {
        position: -webkit-sticky !important;
        position: sticky !important;
        top: 0 !important;
        align-self: start !important;
    }
}

.wbc-results-column {
    min-width: 0;
    max-width: 100%;
    overflow: visible;
    width: 100%;
    box-sizing: border-box;
}

.wbc-results-column * {
    max-width: 100%;
    box-sizing: border-box;
}

/* Header */
.wbc-header {
    text-align: center;
    margin-bottom: 48px;
    padding-bottom: 0;
}

.wbc-header p {
    max-width: none;
    margin: 0;
    line-height: 1.7;
    font-weight: 400;
}

/* Section headings */
.wbc-form-column h2,
.wbc-results-column h2 {
    font-weight: 500;
    margin-bottom: 20px;
    margin-top: 0;
    letter-spacing: -0.01em;
    text-align: center;
}

.wbc-results-column h3 {
    font-weight: 600;
    text-align: center;
    margin: 32px 0 16px 0;
    padding-top: 24px;
    display: block !important;
    visibility: visible !important;
}

.wbc-form-column h3 {
    font-weight: 600;
    font-size: 1rem;
    margin-top: 24px;
    margin-bottom: 16px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    color: #475569;
}

/* Labels */
.wbc-form-column > label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    margin-top: 0;
    letter-spacing: -0.005em;
    cursor: default !important;
}

/* Tooltip styles */
.wbc-tooltip {
    display: inline-block;
    margin-left: 6px;
    width: 18px;
    height: 18px;
    background: #64748b;
    color: white;
    border-radius: 50%;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    line-height: 18px;
    transition: all 0.2s ease;
    vertical-align: middle;
    flex-shrink: 0;
}

.wbc-tooltip:hover {
    background: #475569;
    transform: scale(1.1);
}

.wbc-tooltip.active {
    z-index: 99999;
}

.wbc-tooltip.active::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 400;
    white-space: normal;
    width: 280px;
    text-align: left;
    z-index: 99999;
    box-shadow: var(--shadow-lg);
    line-height: 1.5;
    pointer-events: none;
}

.wbc-tooltip.active::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e293b;
    z-index: 99999;
    pointer-events: none;
}

/* Input wrapper for currency symbols */
.wbc-input-wrapper {
    position: relative;
}

.wbc-currency {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 500;
    font-size: 1em;
    pointer-events: none;
    z-index: 2;
    color: #64748b;
}

/* Input styles */
input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 14px 16px 14px 26px;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    font-family: inherit;
    font-weight: 400;
}

/* Budget input - larger styling */
.wbc-budget-input input {
    font-size: 1.1rem;
    font-weight: 600;
    padding: 16px 35px 16px 28px;
}

/* Custom stepper buttons */
.wbc-stepper {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    gap: 1px;
}

.wbc-stepper-btn {
    width: 16px;
    height: 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    position: relative;
}

.wbc-stepper-btn::before {
    content: '';
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    display: block;
}

.wbc-stepper-btn--up::before {
    border-bottom: 4px solid #555;
    border-top: none;
}

.wbc-stepper-btn--down::before {
    border-top: 4px solid #555;
    border-bottom: none;
}

.wbc-stepper-btn:hover::before {
    border-bottom-color: #333 !important;
    border-top-color: #333 !important;
}

/* Show steppers on hover/focus */
.wbc-budget-input:hover .wbc-stepper {
    opacity: 1;
    pointer-events: auto;
}

.wbc-budget-input:has(input:focus) .wbc-stepper {
    opacity: 1;
    pointer-events: auto;
}

.wbc-budget-input:hover .wbc-stepper .wbc-stepper-btn,
.wbc-budget-input:has(input:focus) .wbc-stepper .wbc-stepper-btn {
    pointer-events: auto;
}

.wbc-budget-input input {
    padding-right: 35px;
}

input[type="text"]::placeholder {
    color: rgba(0, 0, 0, 0.55);
    opacity: 1;
}

input[type="text"]:focus,
input[type="number"]:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgb(236 72 153 / 0.15);
}

/* Expenses grid */
.wbc-expenses-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: center;
}

/* Expense grid items - labels and inputs as direct children */
.wbc-expenses-grid label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #475569;
    display: flex;
    align-items: center;
}

.wbc-expenses-grid input {
    padding: 10px 35px 10px 22px;
    font-size: 0.9rem;
}

.wbc-expenses-grid .wbc-currency {
    left: 10px;
    top: 45%;
    transform: translateY(-50%);
    font-size: 0.9em;
}

/* Show steppers on expense items on hover/focus */
.wbc-expenses-grid .wbc-input-wrapper:hover .wbc-stepper {
    opacity: 1;
    pointer-events: auto;
}

.wbc-expenses-grid .wbc-input-wrapper:has(input:focus) .wbc-stepper {
    opacity: 1;
    pointer-events: auto;
}

.wbc-expenses-grid .wbc-input-wrapper:hover .wbc-stepper .wbc-stepper-btn,
.wbc-expenses-grid .wbc-input-wrapper:has(input:focus) .wbc-stepper .wbc-stepper-btn {
    pointer-events: auto;
}

/* Smaller steppers for expense items */
.wbc-expenses-grid .wbc-stepper {
    right: 6px;
}

.wbc-expenses-grid .wbc-stepper-btn {
    width: 14px;
    height: 14px;
}

/* Disclaimer text */
.wbc-disclaimer-text {
    margin-top: 24px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: #f3f3f3;
    border-left: 3px solid #cbd5e1;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: #475569;
    line-height: 1.5;
}

/* Button styles */
.wbc-download-section {
    display: flex;
    gap: 12px;
    width: 100%;
    margin-top: 32px;
    margin-bottom: 0;
}

.wbc-download-section .c-btn {
    flex: 1;
}

.wbc-button-mobile {
    display: none;
}

/* Results section - separate cards */

/* Budget Status Card */
.wbc-budget-status {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 26px;
    padding-bottom: 32px;
    margin-bottom: 24px;
    text-align: center;
    overflow: visible !important;
    color: #1e293b;
}

.wbc-budget-status h2 {
    text-align: center;
    margin-bottom: 20px;
    margin-top: 0;
}

.wbc-status-label {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 8px;
    text-align: center;
    font-weight: 500;
}

.wbc-main-value {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-align: center;
    margin-bottom: 0;
}

.wbc-main-value.wbc-under {
    color: var(--paletteColor3, #10b981);
}

.wbc-main-value.wbc-over {
    color: #dc2626;
}

.wbc-explanation-text {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #475569;
}

/* Breakdown Card */
.wbc-breakdown {
    background: #f8fafc;
    padding: 26px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 24px;
}

.wbc-breakdown h3 {
    text-align: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 0;
}

.wbc-breakdown-items {
    display: flex !important;
    flex-direction: column;
    gap: 8px;
    min-height: 50px;
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 24px;
    visibility: visible !important;
    opacity: 1 !important;
}

.wbc-breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.wbc-breakdown-label {
    color: #475569;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wbc-breakdown-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    flex-shrink: 0;
}

.wbc-breakdown-value {
    font-weight: 600;
    color: #334155;
}

.wbc-breakdown-percent {
    font-size: 0.8rem;
    color: #64748b;
    margin-left: 8px;
}

/* Chart Section Card */
.wbc-chart-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 26px;
    margin-bottom: 24px;
    box-shadow: none;
}

.wbc-chart-header {
    display: flex;
    align-items: center;
    position: relative;
}

.wbc-chart-section h2 {
    margin-bottom: 0;
    flex: 1;
    text-align: center;
}

.wbc-chart-header .wbc-chart-toggle {
    position: absolute;
    right: 0;
}

.wbc-chart-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-family: inherit;
    flex-shrink: 0;
}

.wbc-chart-toggle:hover {
    background: #f1f5f9;
}

.wbc-caret {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 8px solid #64748b;
    transition: transform 0.3s ease;
    display: block;
}

.wbc-chart-toggle[aria-expanded="false"] .wbc-caret {
    transform: rotate(180deg);
}

.wbc-chart-toggle:hover .wbc-caret {
    border-bottom-color: #475569;
}

.wbc-chart-content {
    margin-top: 20px;
    overflow: hidden;
    max-height: 1000px;
    opacity: 1;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin-top 0.3s ease;
}

.wbc-chart-content.collapsed {
    max-height: 0 !important;
    margin-top: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
    overflow: hidden;
}

.wbc-chart-wrapper {
    position: relative;
    height: 300px;
    width: 100%;
    display: block !important;
    visibility: visible !important;
}

.wbc-chart-content canvas {
    max-width: 100%;
    height: 300px !important;
    width: 100% !important;
    display: block;
}

/* Responsive */
@media (max-width: 950px) {
    .wbc-container {
        max-width: 750px;
        padding: 0 1.5rem;
        margin: 1.5rem auto 3rem auto;
    }
}

@media (max-width: 900px) {
    .wbc-download-section {
        flex-direction: column;
    }
    
    .wbc-download-section .c-btn {
        width: 100%;
    }
}

@media (max-width: 750px) {
    .wbc-container {
        max-width: 100%;
        margin: 0.5rem auto 1rem auto;
        padding: 0;
    }
    
    .wbc-calculator-layout {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
    
    .c-matter--article .wbc-calculator-layout {
        grid-template-columns: 1fr !important;
    }
    
    .wbc-form-column {
        position: static !important;
        padding: 16px;
    }
    
    .wbc-results-column {
        position: static !important;
        min-height: 0 !important;
        padding: 0 !important;
    }
    
    .wbc-header {
        text-align: left;
        margin-bottom: 24px;
    }
    
    .wbc-budget-status,
    .wbc-breakdown,
    .wbc-chart-section {
        margin-left: 0;
        margin-right: 0;
        padding: 20px;
    }
    
    .wbc-results-column h2 {
        text-align: left;
    }
    
    .wbc-expenses-grid {
        grid-template-columns: 1fr !important;
    }
    
    .wbc-download-section {
        display: none;
    }
    
    .wbc-button-mobile {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin-top: 24px;
        width: 100%;
    }
    
    .wbc-button-mobile .c-btn {
        width: 100%;
    }
    
}

@media (max-width: 480px) {
    .wbc-form-column {
        padding: 12px;
    }
    
    .wbc-results-column {
        padding: 16px 12px;
    }
    
    .wbc-main-value {
        font-size: 2rem;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
    }
    
    .wbc-container {
        box-shadow: none;
        margin: 0;
        padding: 0;
    }
    
    .wbc-form-column,
    .wbc-download-section,
    .wbc-button-mobile {
        display: none;
    }
}

