/* ============================================
   ESTIMATE CALCULATOR STYLES
   ============================================ */

/* Section Styling */
.estimate-calculator {
    background: linear-gradient(135deg, #F7F5F2 0%, #FFFFFF 100%);
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.estimate-calculator::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><rect width="100" height="100" fill="none"/><path d="M0 0 L100 100 M100 0 L0 100" stroke="%23C5A572" stroke-width="0.5" opacity="0.05"/></svg>');
    opacity: 0.4;
    pointer-events: none;
    animation: subtle-float 20s ease-in-out infinite;
}

@keyframes subtle-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Calculator Layout */
.calculator-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Calculator Form */
.calculator-form {
    background: #FFFFFF;
    padding: 48px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(197, 165, 114, 0.15);
    border: 1px solid rgba(197, 165, 114, 0.2);
}

.calc-section {
    margin-bottom: 40px;
}

.calc-section:last-of-type {
    margin-bottom: 32px;
}

.calc-section-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1A202C;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.calc-section-title i {
    color: #C5A572;
    font-size: 1.25rem;
}

/* Radio/Checkbox Options */
.calc-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* Project Type Tabs (enhanced for tab-like appearance) */
.calc-section.project-type-section .calc-options {
    display: flex;
    gap: 0;
    border-bottom: 3px solid rgba(197, 165, 114, 0.2);
    margin-bottom: 32px;
}

.calc-section.project-type-section .calc-option {
    flex: 1;
}

.calc-section.project-type-section .calc-option .option-card {
    min-height: auto;
    padding: 20px 16px;
    border-radius: 12px 12px 0 0;
    border: 2px solid rgba(197, 165, 114, 0.1);
    border-bottom: 3px solid transparent;
    background: #F7F5F2;
    position: relative;
    margin-bottom: -3px;
}

.calc-section.project-type-section .calc-option .option-card:hover {
    background: #FAF8F5;
    border-bottom-color: rgba(197, 165, 114, 0.5);
    transform: translateY(0);
}

.calc-section.project-type-section .calc-option input:checked + .option-card {
    background: #FFFFFF;
    border-color: rgba(197, 165, 114, 0.4);
    border-bottom: 3px solid #C5A572;
    box-shadow: 0 -2px 8px rgba(197, 165, 114, 0.15);
    z-index: 1;
}

.calc-section.project-type-section .calc-option .option-card i {
    font-size: 2rem;
    margin-bottom: 8px;
}

.calc-section.project-type-section .calc-option .option-card strong {
    font-size: 1.0625rem;
}

.calc-section.project-type-section .calc-option .option-card small {
    font-size: 0.8125rem;
}

.calc-option input[type="radio"],
.calc-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.calc-option .option-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 16px;
    background: #F7F5F2;
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 140px;
    justify-content: center;
}

.calc-option .option-card:hover {
    border-color: #C5A572;
    background: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(197, 165, 114, 0.2);
}

.calc-option input:checked + .option-card {
    border-color: #C5A572;
    background: linear-gradient(135deg, #FAF8F5 0%, #FFFFFF 100%);
    box-shadow: 0 4px 16px rgba(197, 165, 114, 0.25);
}

.calc-option .option-card i {
    font-size: 2.5rem;
    color: #C5A572;
    margin-bottom: 12px;
}

.calc-option .option-card strong {
    font-size: 1.0625rem;
    color: #1A202C;
    margin-bottom: 6px;
    display: block;
}

.calc-option .option-card small {
    font-size: 0.875rem;
    color: #64748B;
    line-height: 1.4;
    display: block;
}

.calc-option .option-card .multiplier {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 12px;
    background: #C5A572;
    color: #FFFFFF;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Input Group */
.calc-input-group {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.calc-input-group input[type="number"] {
    flex: 1;
    padding: 16px 20px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1A202C;
    border: 2px solid #E2E8F0;
    border-radius: 12px;
    background: #FFFFFF;
    transition: all 0.3s ease;
}

.calc-input-group input[type="number"]:focus {
    outline: none;
    border-color: #C5A572;
    box-shadow: 0 0 0 3px rgba(197, 165, 114, 0.1);
}

.calc-input-group .input-unit {
    font-size: 1.125rem;
    font-weight: 600;
    color: #64748B;
}

/* Slider */
.calc-slider {
    margin-bottom: 16px;
}

.calc-slider input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #C5A572 0%, #E8D5B7 100%);
    outline: none;
    -webkit-appearance: none;
}

.calc-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #C5A572;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(197, 165, 114, 0.4);
    transition: all 0.3s ease;
}

.calc-slider input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(197, 165, 114, 0.6);
}

.calc-slider input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #C5A572;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(197, 165, 114, 0.4);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
}

.slider-labels span {
    font-size: 0.875rem;
    color: #64748B;
    font-weight: 500;
}

/* Checkboxes */
.calc-checkboxes {
    display: grid;
    gap: 12px;
}

.calc-checkbox {
    display: block;
    cursor: pointer;
}

.calc-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.calc-checkbox > span {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: #F7F5F2;
    border: 2px solid transparent;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.calc-checkbox:hover > span {
    border-color: #C5A572;
    background: #FFFFFF;
}

.calc-checkbox input:checked + span {
    border-color: #C5A572;
    background: linear-gradient(135deg, #FAF8F5 0%, #FFFFFF 100%);
    box-shadow: 0 2px 8px rgba(197, 165, 114, 0.15);
}

.calc-checkbox i {
    font-size: 1.5rem;
    color: #C5A572;
    min-width: 24px;
    text-align: center;
}

.calc-checkbox strong {
    display: block;
    font-size: 1rem;
    color: #1A202C;
    margin-bottom: 2px;
}

.calc-checkbox small {
    display: block;
    font-size: 0.875rem;
    color: #64748B;
}

/* Calculate Button */
#calculate-estimate {
    width: 100%;
    font-size: 1.125rem;
    padding: 20px 32px;
    gap: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#calculate-estimate i {
    font-size: 1.25rem;
}

/* Results Panel */
.calculator-results {
    background: linear-gradient(135deg, #2D3748 0%, #1A202C 100%);
    padding: 48px;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(29, 32, 44, 0.3);
    border: 2px solid #C5A572;
    color: #FFFFFF;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Project Summary in Results */
.project-summary {
    padding: 16px 20px;
    background: rgba(197, 165, 114, 0.15);
    border-radius: 8px;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #FFFFFF;
    border-left: 4px solid #C5A572;
    text-align: center;
}

.project-summary strong {
    color: #D6B15B;
    font-weight: 700;
}

.project-summary i {
    margin-right: 4px;
}

.results-header {
    text-align: center;
    padding-bottom: 24px;
    border-bottom: 2px solid rgba(197, 165, 114, 0.3);
}

.results-header i {
    font-size: 3rem;
    color: #C5A572;
    margin-bottom: 16px;
}

.results-header h3 {
    font-size: 1.75rem;
    font-weight: 800;
    color: #FFFFFF;
    margin-bottom: 8px;
}

.results-header p {
    font-size: 1rem;
    color: #CBD5E1;
}

/* Estimate Range Display */
.estimate-range {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 32px 0;
}

.estimate-low,
.estimate-high {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.estimate-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #CBD5E1;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.estimate-value {
    font-size: 2.5rem;
    font-weight: 900;
    color: #C5A572;
    line-height: 1;
}

.estimate-divider {
    font-size: 2rem;
    color: #64748B;
    font-weight: 300;
}

/* Breakdown */
.estimate-breakdown {
    background: rgba(255, 255, 255, 0.05);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid rgba(197, 165, 114, 0.2);
}

.estimate-breakdown h4 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 16px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.breakdown-item:last-child {
    border-bottom: none;
}

.breakdown-item span:first-child {
    font-size: 1rem;
    color: #CBD5E1;
}

.breakdown-item span:last-child {
    font-size: 1.125rem;
    font-weight: 700;
    color: #C5A572;
}

/* Disclaimer */
.estimate-disclaimer {
    background: rgba(197, 165, 114, 0.1);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #C5A572;
    display: flex;
    gap: 16px;
}

.estimate-disclaimer i {
    font-size: 1.5rem;
    color: #C5A572;
    flex-shrink: 0;
    margin-top: 2px;
}

.estimate-disclaimer p {
    font-size: 0.9375rem;
    color: #E2E8F0;
    line-height: 1.6;
    margin: 0;
}

.estimate-disclaimer strong {
    color: #C5A572;
}

/* CTA Buttons */
.estimate-cta {
    display: flex;
    gap: 16px;
}

.estimate-cta .btn {
    flex: 1;
    justify-content: center;
}

.estimate-cta .btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    border: 2px solid rgba(197, 165, 114, 0.5);
}

.estimate-cta .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #C5A572;
}

/* Feature Pills */
.estimate-features {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding-top: 24px;
    border-top: 2px solid rgba(197, 165, 114, 0.3);
}

.estimate-features .feature {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #CBD5E1;
}

.estimate-features .feature i {
    font-size: 1.125rem;
    color: #C5A572;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .calculator-wrapper {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .calc-options {
        grid-template-columns: 1fr;
    }

    .estimate-cta {
        flex-direction: column;
    }

    .estimate-features {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
}

/* Expandable Section */
.calc-section-expandable {
    border-top: 2px solid rgba(197, 165, 114, 0.2);
    padding-top: 32px;
    margin-top: 32px;
}

.calc-expand-btn {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, rgba(197, 165, 114, 0.1) 0%, rgba(232, 213, 183, 0.1) 100%);
    border: 2px solid rgba(197, 165, 114, 0.3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: #C5A572;
    cursor: pointer;
    transition: all 0.3s ease;
}

.calc-expand-btn:hover {
    background: linear-gradient(135deg, rgba(197, 165, 114, 0.15) 0%, rgba(232, 213, 183, 0.15) 100%);
    border-color: #C5A572;
    transform: translateY(-2px);
}

.calc-expand-btn i {
    font-size: 1.125rem;
    transition: transform 0.3s ease;
}

.calc-expand-btn.expanded i {
    transform: rotate(180deg);
}

.calc-expandable-content {
    margin-top: 24px;
    padding: 24px;
    background: rgba(247, 245, 242, 0.5);
    border-radius: 12px;
    border: 1px solid rgba(197, 165, 114, 0.15);
}

.calc-input-row {
    margin-bottom: 20px;
}

.calc-input-row:last-child {
    margin-bottom: 0;
}

.calc-input-row label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1A202C;
    margin-bottom: 8px;
}

.calc-input-row label i {
    color: #C5A572;
    font-size: 1.125rem;
}

.calc-input-row input[type="number"],
.calc-input-row select,
.calc-input-row textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    color: #1A202C;
    border: 2px solid #E2E8F0;
    border-radius: 8px;
    background: #FFFFFF;
    transition: all 0.3s ease;
}

.calc-input-row input:focus,
.calc-input-row select:focus,
.calc-input-row textarea:focus {
    outline: none;
    border-color: #C5A572;
    box-shadow: 0 0 0 3px rgba(197, 165, 114, 0.1);
}

.calc-input-row textarea {
    resize: vertical;
    font-family: inherit;
}

/* Project Type Info Boxes */
.project-type-info {
    margin-top: 20px;
}

.info-box {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(197, 165, 114, 0.08) 0%, rgba(197, 165, 114, 0.12) 100%);
    border-left: 4px solid #C5A572;
    border-radius: 8px;
    margin-bottom: 0;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.info-box i {
    color: #C5A572;
    font-size: 1.25rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.info-box p {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #1A202C;
}

.info-box strong {
    color: #C5A572;
    font-weight: 700;
}

/* Photo Upload Section */
.calc-photo-upload {
    border: 3px solid rgba(197, 165, 114, 0.3);
    border-radius: 16px;
    padding: 32px;
    margin-top: 32px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(250, 248, 245, 0.8) 100%);
    box-shadow: 0 4px 12px rgba(197, 165, 114, 0.1);
}

.calc-photo-upload .calc-section-title {
    color: #C5A572;
    font-size: 1.25rem;
}

.calc-section-title .optional-badge {
    display: inline-block;
    margin-left: 12px;
    padding: 6px 14px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.25) 100%);
    color: #059669;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid rgba(16, 185, 129, 0.3);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1); }
}

/* Help Text for Calculator Sections */
.calc-section-help {
    display: block;
    font-size: 0.875rem;
    color: #64748B;
    margin-top: 8px;
    font-style: italic;
}

/* Enhanced Calculate Button */
#calculate-estimate {
    width: 100%;
    margin-top: 16px;
    font-size: 1.125rem;
    padding: 18px 32px;
    background: linear-gradient(135deg, #C5A572 0%, #D6B15B 100%);
    border: none;
    color: #FFFFFF;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(197, 165, 114, 0.3);
    position: relative;
    overflow: hidden;
}

#calculate-estimate::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

#calculate-estimate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(197, 165, 114, 0.4);
}

#calculate-estimate:hover::before {
    width: 300px;
    height: 300px;
}

#calculate-estimate:active {
    transform: translateY(0);
}

#calculate-estimate i {
    margin-right: 8px;
}

.photo-upload-container {
    margin-top: 20px;
}

.upload-area {
    position: relative;
    border: 3px dashed rgba(197, 165, 114, 0.3);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(247, 245, 242, 0.5) 0%, rgba(255, 255, 255, 0.5) 100%);
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: #C5A572;
    background: linear-gradient(135deg, rgba(247, 245, 242, 0.8) 0%, rgba(255, 255, 255, 0.8) 100%);
}

.upload-area.dragover {
    border-color: #10B981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(16, 185, 129, 0.1) 100%);
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    cursor: pointer;
    text-align: center;
    gap: 12px;
}

.upload-label i {
    font-size: 3rem;
    color: #C5A572;
    margin-bottom: 8px;
}

.upload-label strong {
    font-size: 1.0625rem;
    color: #1A202C;
    display: block;
}

.upload-label small {
    font-size: 0.875rem;
    color: #64748B;
    display: block;
    max-width: 400px;
    line-height: 1.5;
}

/* Uploaded Photos Preview */
.uploaded-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.photo-preview {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(197, 165, 114, 0.2);
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-preview .remove-photo {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.9);
    color: #FFFFFF;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.photo-preview .remove-photo:hover {
    background: #DC2626;
    transform: scale(1.1);
}

.photo-preview .analyzing {
    position: absolute;
    inset: 0;
    background: rgba(197, 165, 114, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    font-size: 0.875rem;
    font-weight: 600;
}

.photo-preview .analyzing i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* AI Analysis Result */
.ai-analysis-result {
    margin-top: 24px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(16, 185, 129, 0.1) 100%);
    border: 2px solid rgba(16, 185, 129, 0.3);
    border-radius: 12px;
}

.analysis-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    color: #10B981;
    font-size: 1.0625rem;
}

.analysis-header i {
    font-size: 1.25rem;
}

.analysis-content {
    color: #334155;
    font-size: 0.9375rem;
    line-height: 1.6;
}

.analysis-content ul {
    list-style: none;
    padding: 0;
    margin: 12px 0 0 0;
}

.analysis-content li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(16, 185, 129, 0.1);
    display: flex;
    align-items: start;
    gap: 10px;
}

.analysis-content li:last-child {
    border-bottom: none;
}

.analysis-content li i {
    color: #10B981;
    margin-top: 2px;
}

.analysis-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #64748B;
    font-style: italic;
}

.analysis-loading i {
    animation: spin 1s linear infinite;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .estimate-calculator {
        padding: 60px 0;
    }

    .calculator-form,
    .calculator-results {
        padding: 32px 24px;
    }

    .calc-section {
        margin-bottom: 32px;
    }

    .calc-option .option-card {
        min-height: 120px;
        padding: 20px 12px;
    }

    .calc-option .option-card i {
        font-size: 2rem;
    }

    .estimate-value {
        font-size: 2rem;
    }

    .estimate-range {
        flex-direction: column;
        gap: 16px;
    }

    .estimate-divider {
        transform: rotate(90deg);
    }
}
