/**
 * Funeral Cost Calculator - Enhanced Edition CSS
 * Clean, professional design with warm accents
 */

/* CSS Variables for easy theming */
:root {
    --fce-primary: #8b653f;
    --fce-primary-dark: #6b4d2f;
    --fce-secondary: #f5f5f0;
    --fce-text-dark: #2d3748;
    --fce-text-light: #718096;
    --fce-border: #e2e8f0;
    --fce-white: #ffffff;
    --fce-background: #fafaf8;
    --fce-radius: 12px;
    --fce-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --fce-shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Base Styles */
.fce-calculator {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--fce-text-dark);
    background: var(--fce-background);
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Typography */
.fce-calculator h1,
.fce-calculator h2,
.fce-calculator h3,
.fce-category-title {
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 700;
    color: var(--fce-text-dark);
    line-height: 1.2;
}

.fce-calculator h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.fce-calculator h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.fce-calculator h3 {
    font-size: 1.5rem;
}

/* Mode Toggle */
.fce-mode-toggle {
    display: flex;
    gap: 12px;
    margin-bottom: 40px;
    justify-content: center;
}

.fce-mode-btn {
    background: var(--fce-white);
    border: 2px solid var(--fce-border);
    padding: 12px 24px;
    border-radius: var(--fce-radius);
    font-size: 15px;
    font-weight: 600;
    color: var(--fce-text-dark);
    cursor: pointer;
    transition: all 0.2s;
}

.fce-mode-btn:hover {
    border-color: var(--fce-primary);
    color: var(--fce-primary);
}

.fce-mode-btn.active {
    background: var(--fce-primary);
    border-color: var(--fce-primary);
    color: var(--fce-white);
}

/* Sections */
.fce-section {
    background: var(--fce-white);
    border-radius: var(--fce-radius);
    padding: 40px;
    margin-bottom: 32px;
    box-shadow: var(--fce-shadow);
}

.fce-section-title {
    font-size: 2rem;
    margin-bottom: 12px;
    color: var(--fce-text-dark);
}

.fce-section-desc {
    font-size: 17px;
    color: var(--fce-text-light);
    margin-bottom: 32px;
}

/* Package Cards */
.fce-package-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.fce-package-card {
    position: relative;
    display: block;
    cursor: pointer;
}

.fce-package-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.fce-package-content {
    background: var(--fce-secondary);
    border: 2px solid var(--fce-border);
    border-radius: var(--fce-radius);
    padding: 28px 24px;
    transition: all 0.2s;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.fce-package-card:hover .fce-package-content {
    border-color: var(--fce-primary);
    transform: translateY(-2px);
    box-shadow: var(--fce-shadow-lg);
}

.fce-package-card input:checked ~ .fce-package-content {
    border-color: var(--fce-primary);
    border-width: 3px;
    background: var(--fce-white);
}

.fce-package-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.fce-package-content h3 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.fce-package-price {
    font-size: 16px;
    color: var(--fce-primary);
    font-weight: 600;
    margin-bottom: 12px;
}

.fce-package-desc {
    font-size: 14px;
    color: var(--fce-text-light);
    line-height: 1.5;
}

/* Categories / Accordions */
.fce-category {
    background: var(--fce-white);
    border: 1px solid var(--fce-border);
    border-radius: var(--fce-radius);
    margin-bottom: 16px;
    overflow: hidden;
}

.fce-category-title {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px;
    margin: 0;
    font-size: 1.5rem;
}

.fce-category-icon {
    font-size: 28px;
}

/* Accordion Styles */
.fce-accordion-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    background: var(--fce-secondary);
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    text-align: left;
}

.fce-accordion-header:hover {
    background: #f0f0eb;
}

.fce-accordion.open .fce-accordion-header {
    background: var(--fce-white);
    border-bottom: 1px solid var(--fce-border);
}

.fce-accordion-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: Georgia, serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--fce-text-dark);
}

.fce-accordion-icon {
    font-size: 28px;
}

.fce-accordion-toggle {
    font-size: 32px;
    line-height: 1;
    color: var(--fce-primary);
    font-weight: 300;
}

.fce-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.fce-accordion.open .fce-accordion-content {
    max-height: 2000px;
    transition: max-height 0.5s ease-in;
}

.fce-category-note {
    padding: 20px 24px;
    color: var(--fce-text-light);
    font-size: 14px;
    font-style: italic;
}

/* Items */
.fce-items {
    padding: 20px;
}

.fce-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    min-height: 60px;
}

.fce-item:hover {
    background: var(--fce-secondary);
}

.fce-item input[type="checkbox"],
.fce-item input[type="radio"] {
    width: 24px;
    height: 24px;
    margin-right: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.fce-item-name {
    flex: 1;
    font-size: 16px;
    color: var(--fce-text-dark);
}

.fce-item-price {
    font-size: 16px;
    font-weight: 600;
    color: var(--fce-primary);
    margin-left: 16px;
}

/* Totals Section */
.fce-totals-section {
    background: var(--fce-white);
    border-radius: var(--fce-radius);
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: var(--fce-shadow);
}

.fce-totals-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 24px;
}

.fce-total-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    font-size: 16px;
    color: var(--fce-text-light);
}

.fce-total-item span:last-child {
    font-weight: 600;
    color: var(--fce-text-dark);
}

.fce-grand-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0 0;
    border-top: 2px solid var(--fce-border);
    font-size: 24px;
    font-weight: 700;
}

.fce-grand-total span:last-child {
    color: var(--fce-primary);
    font-size: 32px;
}

/* Action Buttons */
.fce-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 32px;
}

.fce-btn {
    padding: 16px 28px;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--fce-radius);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.fce-btn-primary {
    background: var(--fce-primary);
    color: var(--fce-white);
}

.fce-btn-primary:hover {
    background: var(--fce-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--fce-shadow-lg);
}

.fce-btn-secondary {
    background: var(--fce-white);
    color: var(--fce-text-dark);
    border-color: var(--fce-border);
}

.fce-btn-secondary:hover {
    border-color: var(--fce-primary);
    color: var(--fce-primary);
}

/* Breakdown */
.fce-breakdown {
    background: var(--fce-white);
    border-radius: var(--fce-radius);
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: var(--fce-shadow);
}

.fce-breakdown h3 {
    margin-bottom: 24px;
}

.fce-breakdown-category {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--fce-primary);
    margin-top: 24px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--fce-border);
}

.fce-breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    font-size: 15px;
}

.fce-breakdown-item span:last-child {
    font-weight: 600;
    color: var(--fce-primary);
}

/* Disclaimer */
.fce-disclaimer {
    background: var(--fce-secondary);
    border-radius: var(--fce-radius);
    padding: 28px;
    margin-bottom: 32px;
    border-left: 4px solid var(--fce-primary);
}

.fce-disclaimer h4 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 18px;
}

.fce-disclaimer p {
    margin-bottom: 12px;
    color: var(--fce-text-light);
    line-height: 1.6;
}

.fce-disclaimer p:last-child {
    margin-bottom: 0;
}

/* Comparison Mode */
.fce-comparison-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 32px 0;
}

.fce-compare-option {
    display: block;
    padding: 20px;
    background: var(--fce-secondary);
    border: 2px solid var(--fce-border);
    border-radius: var(--fce-radius);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.fce-compare-option:hover {
    border-color: var(--fce-primary);
    transform: translateY(-2px);
}

.fce-compare-option input {
    margin-right: 8px;
}

.fce-compare-option span {
    font-size: 16px;
    font-weight: 600;
}

.fce-comparison-table {
    background: var(--fce-white);
    border-radius: var(--fce-radius);
    padding: 24px;
    margin: 32px 0;
    overflow-x: auto;
    box-shadow: var(--fce-shadow);
}

.fce-comparison-grid {
    width: 100%;
    border-collapse: collapse;
}

.fce-comparison-grid th,
.fce-comparison-grid td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--fce-border);
}

.fce-comparison-grid th {
    background: var(--fce-primary);
    color: var(--fce-white);
    font-weight: 600;
    position: sticky;
    top: 0;
}

.fce-comparison-grid .fce-category-row td {
    background: var(--fce-secondary);
    font-weight: 700;
    color: var(--fce-primary);
}

.fce-comparison-grid .fce-total-row {
    font-weight: 700;
    font-size: 18px;
    background: var(--fce-secondary);
}

.fce-comparison-grid .fce-check-cell {
    text-align: center;
    font-size: 20px;
    color: var(--fce-primary);
}

/* Branding */
.fce-branding {
    text-align: center;
    padding: 32px 20px;
    margin-top: 40px;
    border-top: 2px solid var(--fce-border);
    color: var(--fce-text-light);
}

.fce-branding p {
    margin: 8px 0;
}

.fce-branding strong {
    color: var(--fce-primary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .fce-calculator {
        padding: 24px 16px;
    }
    
    .fce-section {
        padding: 24px 20px;
    }
    
    .fce-calculator h1 {
        font-size: 2.25rem;
    }
    
    .fce-section-title {
        font-size: 1.5rem;
    }
    
    .fce-package-grid {
        grid-template-columns: 1fr;
    }
    
    .fce-actions {
        flex-direction: column;
    }
    
    .fce-btn {
        width: 100%;
    }
    
    .fce-grand-total {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .fce-comparison-table {
        overflow-x: scroll;
    }
}

/* Print Styles */
@media print {
    .fce-mode-toggle,
    .fce-actions,
    .fce-branding {
        display: none;
    }
    
    .fce-accordion-content {
        max-height: none !important;
    }
    
    .fce-calculator {
        background: white;
    }
}

/* Accessibility */
.fce-btn:focus,
.fce-item:focus-within,
.fce-package-card:focus-within,
.fce-accordion-header:focus {
    outline: 2px solid var(--fce-primary);
    outline-offset: 2px;
}

/* Loading State */
.fce-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Email Capture Modal */
.fce-email-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
}

.fce-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    cursor: pointer;
}

.fce-modal-content {
    position: relative;
    max-width: 500px;
    margin: 100px auto;
    background: white;
    padding: 40px 30px;
    border-radius: 12px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    z-index: 100000;
    text-align: center;
}

.fce-modal-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.fce-modal-content h3 {
    margin: 0 0 10px;
    font-size: 24px;
    color: #333;
}

.fce-modal-content p {
    margin-bottom: 25px;
    color: #666;
}

.fce-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: #999;
    width: 40px;
    height: 40px;
    padding: 0;
    line-height: 1;
}

.fce-modal-close:hover {
    color: #333;
}

.fce-email-form input[type="email"],
.fce-email-form input[type="text"] {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.fce-email-form input:focus {
    outline: none;
    border-color: #8B653F;
}

.fce-submit-btn {
    width: 100%;
    padding: 15px;
    background: #8B653F;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.fce-submit-btn:hover {
    background: #6F4E32;
}

.fce-privacy-note {
    font-size: 13px;
    color: #888;
    margin-top: 15px;
}

/* Affiliate Offers */
.fce-affiliate-section {
    margin-top: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #f6f9fc 0%, #ffffff 100%);
    border-radius: 12px;
    border: 2px solid #e3e8ee;
}

.fce-affiliate-offers .fce-offers-title {
    margin: 0 0 10px;
    font-size: 24px;
    color: #333;
}

.fce-affiliate-offers .fce-offers-subtitle {
    margin-bottom: 25px;
    color: #666;
    font-size: 16px;
}

.fce-affiliate-card {
    display: flex;
    gap: 20px;
    background: white;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.fce-affiliate-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.fce-offer-icon {
    font-size: 48px;
    flex-shrink: 0;
}

.fce-offer-content {
    flex: 1;
}

.fce-offer-content h4 {
    margin: 0 0 10px;
    font-size: 20px;
    color: #333;
}

.fce-offer-content p {
    margin: 0 0 10px;
    color: #666;
    line-height: 1.6;
}

.fce-offer-note {
    font-size: 14px;
    color: #888;
    font-style: italic;
}

.fce-offer-button {
    display: inline-block;
    margin-top: 15px;
    padding: 12px 24px;
    background: #8B653F;
    color: white !important;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: background 0.3s;
}

.fce-offer-button:hover {
    background: #6F4E32;
}

.fce-disclosure {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e3e8ee;
    text-align: center;
}

.fce-disclosure small {
    color: #888;
    font-size: 12px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .fce-modal-content {
        margin: 20px;
        padding: 30px 20px;
    }
    
    .fce-affiliate-card {
        flex-direction: column;
        text-align: center;
    }
    
    .fce-offer-icon {
        font-size: 36px;
    }
}

/* Enhanced Email Form Styles */
.fce-form-row {
    margin-bottom: 12px;
}

.fce-form-row-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.fce-email-form input[type="email"],
.fce-email-form input[type="text"],
.fce-email-form input[type="tel"],
.fce-email-form select {
    width: 100%;
    padding: 14px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    transition: border-color 0.3s;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.fce-email-form select {
    background-color: white;
    cursor: pointer;
}

.fce-email-form input:focus,
.fce-email-form select:focus {
    outline: none;
    border-color: #8B653F;
}

.fce-email-form input:required:invalid {
    border-color: #ddd;
}

.fce-email-form input:required:valid {
    border-color: #46b450;
}

.fce-modal-content h3 {
    font-size: 22px;
    margin: 0 0 8px;
}

.fce-modal-content > p {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .fce-modal-content {
        margin: 20px;
        padding: 30px 20px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .fce-form-row-split {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .fce-email-form input,
    .fce-email-form select {
        padding: 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* ========================================
   BOLD MODERN BUTTON STYLING
   ======================================== */

/* Dual Actions - Side by Side Buttons */
.fce-actions-dual {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin: 40px 0;
}

/* Calculate Button - Bright Green (Action Color) */
.fce-btn-calculate {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    font-size: 20px;
    padding: 20px 40px;
    font-weight: 800;
    flex: 1;
    min-width: 250px;
    max-width: 350px;
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(34, 197, 94, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fce-btn-calculate:hover {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(34, 197, 94, 0.4);
}

.fce-btn-calculate:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(34, 197, 94, 0.3);
}

/* Download Button - Bright Blue (Primary Action) */
.fce-btn-download {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    font-size: 20px;
    padding: 20px 40px;
    font-weight: 800;
    flex: 1;
    min-width: 250px;
    max-width: 350px;
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fce-btn-download:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(59, 130, 246, 0.4);
}

.fce-btn-download:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

/* Reset Button - Subtle Gray */
.fce-btn-reset {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: white;
    font-size: 16px;
    padding: 14px 30px;
    font-weight: 600;
    max-width: 220px;
    margin: 0 auto;
    display: block;
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(100, 116, 139, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.fce-btn-reset:hover {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(100, 116, 139, 0.3);
}

.fce-btn-reset:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(100, 116, 139, 0.2);
}

/* Action buttons container centering */
.fce-actions {
    text-align: center;
    margin: 30px 0;
}

/* Add pulse animation to calculate button */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 8px 16px rgba(34, 197, 94, 0.3);
    }
    50% {
        box-shadow: 0 8px 24px rgba(34, 197, 94, 0.5);
    }
}

.fce-btn-calculate {
    animation: pulse 2s infinite;
}

/* Results section styling */
#fce-results {
    animation: fadeInUp 0.5s ease-in-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .fce-actions-dual {
        flex-direction: column;
        gap: 15px;
    }
    
    .fce-btn-calculate,
    .fce-btn-download {
        width: 100%;
        max-width: 100%;
        min-width: 100%;
        font-size: 18px;
        padding: 18px 30px;
    }
    
    .fce-btn-reset {
        max-width: 100%;
        width: 100%;
        font-size: 15px;
        padding: 12px 25px;
    }
}

/* Ensure buttons are clickable (higher z-index) */
.fce-btn-calculate,
.fce-btn-download,
.fce-btn-reset {
    position: relative;
    z-index: 10;
}
