/* Wedding Budget Calculator Specific Styles */

/* Form Styles */
#calculatorForm {
    margin-bottom: 24px;
}

/* Section Styling */
.input-section {
    margin-bottom: 24px;
}

.input-section h2 {
    font-size: 16px;
    font-weight: 600;
    color: #003049;
    margin-bottom: 16px;
    padding-left: 12px;
    letter-spacing: 0.3px;
    line-height: 1.2;
    display: flex;
    align-items: center;
    background: linear-gradient(to right, rgba(0, 48, 73, 0.05), transparent);
    padding: 8px 12px;
    border-radius: 4px;
    text-transform: uppercase;
}

.budget-section h2 {
    background: linear-gradient(to right, rgba(37, 99, 235, 0.1), transparent);
    color: #1e40af;
}

.expenses-section h2 {
    background: linear-gradient(to right, rgba(168, 85, 247, 0.1), transparent);
    color: #7c3aed;
}

/* Subsection Styling */
.input-subsection {
    margin-bottom: 20px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.input-subsection h3 {
    font-size: 14px;
    font-weight: 500;
    color: #4b5563;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

/* Input Groups and Error Handling */
.input-group {
    margin-bottom: 16px;
}

.input-group:last-child {
    margin-bottom: 0;
}

.input-group label {
    display: block;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 6px;
    color: #4b5563;
}

.input-wrapper {
    position: relative;
}

.input-group input[type="number"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 16px;
    transition: all 0.2s ease;
    background-color: #fff;
    color: #111827;
}

.input-group input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Catering Toggle Styling */
.catering-toggle-group {
    margin-bottom: 12px;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #4b5563;
}

.toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #2563eb;
}

/* Catering Per Person Layout */
.input-row {
    display: flex;
    gap: 12px;
}

.input-col {
    flex: 1;
}

.input-col label {
    font-size: 14px;
}

.catering-total-display {
    margin-top: 12px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    color: #5b21b6;
    text-align: center;
}

.catering-per-person.hidden {
    display: none;
}

/* Error States */
.input-group input.error {
    border-color: #dc2626;
    background-color: #fff5f5;
    animation: errorShake 0.4s ease-in-out;
}

.input-group input.error:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.error-message {
    display: none;
    color: #dc2626;
    font-size: 14px;
    margin-top: 4px;
    padding-left: 4px;
}

.error-message.visible {
    display: block;
}

/* Stack Layout */
.input-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Action Buttons */
.button-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.calculate-button, .reset-button {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.calculate-button {
    background: #003049;
    color: white;
    border: 1px solid #003049;
}

.calculate-button:hover {
    background: #00436b;
    border-color: #00436b;
}

.reset-button {
    background: white;
    border: 1px solid #ddd;
    color: #333;
}

.reset-button:hover {
    background: #f5f5f5;
    border-color: #003049;
}

/* Results Section */
.results-section {
    background: #f8fafc;
    border-radius: 4px;
    padding: 16px;
    margin-top: 8px;
    width: 100%;
    box-sizing: border-box;
}

.results-section.hidden {
    display: none;
}

.results-section h2 {
    color: #1e40af;
    font-size: 16px;
    margin-bottom: 16px;
}

/* Result Cards */
.result-card {
    background: white;
    border-radius: 4px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.result-card.primary-result {
    border-left: 4px solid #2563eb;
}

.result-card.primary-result.under-budget {
    border-left-color: #16a34a;
}

.result-card.primary-result.over-budget {
    border-left-color: #dc2626;
}

.result-card h3 {
    font-size: 14px;
    color: #4b5563;
    margin-bottom: 4px;
}

.result-value {
    font-size: 24px;
    font-weight: 600;
    color: #1e40af;
    margin: 8px 0;
}

.result-value.under-budget {
    color: #16a34a;
}

.result-value.over-budget {
    color: #dc2626;
}

.result-note {
    font-size: 12px;
    color: #6b7280;
}

/* Result Cards Grid */
.result-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.budget-card {
    border-left: 4px solid #2563eb;
}

.budget-card .result-value {
    color: #1e40af;
}

.expenses-card {
    border-left: 4px solid #7c3aed;
}

.expenses-card .result-value {
    color: #7c3aed;
}

/* Visual Budget Bar */
.visual-breakdown {
    background: white;
    border-radius: 4px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.visual-breakdown h3 {
    font-size: 14px;
    color: #4b5563;
    margin-bottom: 12px;
}

.budget-bar-container {
    margin-top: 8px;
}

.budget-bar {
    display: flex;
    height: 32px;
    border-radius: 4px;
    overflow: hidden;
    background: #e5e7eb;
}

.bar-spent {
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    height: 100%;
    transition: width 0.5s ease;
    min-width: 0;
}

.bar-spent.over-budget {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.bar-remaining {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    height: 100%;
    transition: width 0.5s ease;
    min-width: 0;
}

.bar-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 13px;
}

.bar-label {
    display: flex;
    align-items: center;
    gap: 4px;
}

.spent-label {
    color: #7c3aed;
}

.spent-label.over-budget {
    color: #dc2626;
}

.remaining-label {
    color: #16a34a;
}

/* Typical Budget Breakdown Section */
.typical-breakdown-section {
    background: white;
    border-radius: 4px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.typical-breakdown-section h3 {
    font-size: 14px;
    color: #4b5563;
    margin-bottom: 8px;
}

.typical-note {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 12px;
}

.typical-breakdown {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.typical-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 10px;
    background: #f9fafb;
    border-radius: 4px;
    font-size: 12px;
}

.typical-category {
    color: #4b5563;
}

.typical-percent {
    color: #6366f1;
    font-weight: 500;
}

/* Result Details */
.result-details {
    margin-top: 20px;
}

.result-details h3 {
    font-size: 14px;
    color: #4b5563;
    margin-bottom: 12px;
}

.breakdown {
    background: white;
    border-radius: 4px;
    padding: 16px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.breakdown-item:last-child {
    border-bottom: none;
}

.breakdown-label {
    font-size: 14px;
    color: #4b5563;
}

.breakdown-value {
    font-size: 14px;
    font-weight: 500;
    color: #7c3aed;
}

.breakdown-percent {
    font-weight: 400;
    color: #6b7280;
    font-size: 12px;
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
    .input-section h2 {
        font-size: 14px;
        margin-bottom: 12px;
        padding: 6px 10px;
        padding-left: 10px;
        border-left-width: 2px;
        letter-spacing: 0.2px;
    }

    .input-section {
        margin-bottom: 20px;
    }

    .input-subsection {
        padding: 12px;
        margin-bottom: 16px;
    }

    .input-subsection h3 {
        font-size: 13px;
        margin-bottom: 10px;
    }

    .input-group label {
        font-size: 14px;
        margin-bottom: 4px;
        line-height: 1.3;
    }

    .input-group input[type="number"] {
        font-size: 14px;
        padding: 10px;
        -webkit-appearance: none;
        appearance: none;
        min-height: 44px;
    }

    .error-message {
        font-size: 12px;
    }

    .result-cards-grid {
        grid-template-columns: 1fr;
    }

    .bar-labels {
        flex-direction: column;
        gap: 4px;
    }

    .typical-breakdown {
        grid-template-columns: 1fr;
    }

    .input-row {
        flex-direction: column;
        gap: 16px;
    }
}

/* Deep Mobile Optimizations */
@media (max-width: 480px) {
    .calculator-content {
        padding: 16px;
    }

    .button-group {
        flex-direction: column;
    }

    .calculate-button, .reset-button {
        width: 100%;
        font-size: 16px;
        padding: 14px;
    }

    .result-value {
        font-size: 20px;
    }

    .error-message {
        position: relative;
        padding-top: 4px;
    }

    .input-wrapper {
        width: 100%;
    }

    .breakdown-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .breakdown-value {
        font-size: 13px;
    }

    .typical-item {
        padding: 8px 10px;
    }
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}
