/* Interior Design Cost Calculator Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, rgba(205, 242, 202, 1) 0%, rgba(53, 101, 80, 0.8) 100%);
    min-height: 100vh;
    padding: 10px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    animation: containerFadeIn 0.8s ease-out;
}

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

.header {
    background: linear-gradient(135deg, rgba(53, 101, 80, 1) 0%, rgba(53, 101, 80, 0.9) 100%);
    color: white;
    padding: 20px;
    text-align: center;
    position: relative;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.header-text {
    flex: 1;
    text-align: center;
}

.logo-container {
    display: flex;
    align-items: center;
}

.company-logo {
    height: 80px;
    width: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.company-logo:hover {
    transform: scale(1.05);
}

.header h1 {
    font-size: clamp(20px, 5vw, 32px);
    margin-bottom: 8px;
}

.header p {
    opacity: 0.9;
    font-size: clamp(12px, 3vw, 16px);
}

.form-section {
    padding: 15px;
}

.section {
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid rgba(53, 101, 80, 1);
}

.section.hidden {
    display: none;
}

.section-title {
    font-size: clamp(18px, 4vw, 22px);
    color: #333;
    margin-bottom: 20px;
    font-weight: 600;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
    font-size: clamp(13px, 3vw, 15px);
}

/* Enhanced label for Property Type */
label[for="propertyType"] {
    color: rgba(53, 101, 80, 1);
    font-weight: 600;
    font-size: clamp(15px, 3.5vw, 18px);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

label[for="propertyType"]:before {
    content: "🏠";
    font-size: 20px;
}

select, input[type="number"] {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: clamp(14px, 3vw, 16px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    transform-origin: center;
}

select:hover, input[type="number"]:hover {
    border-color: rgba(53, 101, 80, 1);
    transform: scale(1.005);
}

select:focus, input[type="number"]:focus {
    transform: scale(1.01);
    box-shadow: 0 0 0 3px rgba(53, 101, 80, 0.2);
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Cpath fill='%23356550' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 50px;
    cursor: pointer;
}

/* Enhanced Property Type Dropdown Styling */
#propertyType {
    background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(248, 249, 250, 1) 100%);
    border: 2px solid rgba(53, 101, 80, 0.3);
    padding: 18px 60px 18px 20px;
    font-size: clamp(15px, 3.5vw, 18px);
    font-weight: 500;
    color: #333;
    box-shadow: 0 2px 8px rgba(53, 101, 80, 0.1);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='%23356550' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24'%3E%3Cpath fill='%23356550' d='M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat, no-repeat;
    background-position: right 16px center, left 18px center;
    padding-left: 50px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#propertyType:hover {
    border-color: rgba(53, 101, 80, 0.6);
    box-shadow: 0 4px 16px rgba(53, 101, 80, 0.15);
    transform: translateY(-1px);
    background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(245, 248, 245, 1) 100%);
}

#propertyType:focus {
    outline: none;
    border-color: rgba(53, 101, 80, 1);
    box-shadow: 0 0 0 4px rgba(53, 101, 80, 0.15), 0 4px 16px rgba(53, 101, 80, 0.2);
    transform: translateY(-1px) scale(1.01);
    background: white;
}

#propertyType option {
    padding: 12px 16px;
    font-size: 16px;
    color: #333;
    background: white;
    border: none;
}

#propertyType option:hover {
    background: rgba(53, 101, 80, 0.1);
}

#propertyType option:checked {
    background: rgba(53, 101, 80, 0.2);
    color: rgba(53, 101, 80, 1);
    font-weight: 600;
}

/* Property Type Visual Options Display */
.property-type-options-display {
    margin-top: 10px;
    padding: 15px;
    background: linear-gradient(135deg, rgba(205, 242, 202, 0.1) 0%, rgba(53, 101, 80, 0.05) 100%);
    border: 2px solid rgba(53, 101, 80, 0.2);
    border-radius: 12px;
    animation: optionsSlideIn 0.4s ease-out;
    display: none;
}

.property-type-options-display.show {
    display: block;
}

.property-type-options-title {
    font-weight: 600;
    color: rgba(53, 101, 80, 1);
    margin-bottom: 10px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.property-type-visual-option {
    padding: 12px 16px;
    margin: 8px 0;
    background: white;
    border: 1px solid rgba(53, 101, 80, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 15px;
    font-weight: 500;
    color: rgba(53, 101, 80, 0.9);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 12px;
}

.property-type-visual-option:before {
    content: "🏠";
    font-size: 18px;
    opacity: 0.7;
}

.property-type-visual-option[data-value="individual"]:before {
    content: "🏘️";
}

.property-type-visual-option[data-value="1bhk"]:before {
    content: "🏠";
}

.property-type-visual-option[data-value="2bhk"]:before {
    content: "🏡";
}

.property-type-visual-option[data-value="3bhk"]:before {
    content: "🏢";
}

.property-type-visual-option[data-value="4bhk"]:before {
    content: "🏬";
}

.property-type-visual-option:hover {
    background: rgba(53, 101, 80, 0.1);
    border-color: rgba(53, 101, 80, 0.4);
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(53, 101, 80, 0.2);
}

.property-type-visual-option:active {
    transform: translateX(3px) scale(0.98);
}

.property-type-visual-option.selected {
    background: rgba(53, 101, 80, 1);
    color: white;
    border-color: rgba(53, 101, 80, 1);
    font-weight: 600;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(53, 101, 80, 0.3);
}

.property-type-visual-option.selected:after {
    content: "✓";
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: bold;
    font-size: 16px;
    color: white;
}

.property-type-visual-option.selected:before {
    opacity: 1;
    filter: brightness(0) invert(1);
}

select:focus, input[type="number"]:focus {
    outline: none;
    border-color: rgba(53, 101, 80, 1);
    box-shadow: 0 0 0 3px rgba(53, 101, 80, 0.1);
}

.furniture-item {
    background: white;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    border: 1px solid #e0e0e0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.furniture-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
    border-color: rgba(53, 101, 80, 1);
}

.furniture-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.furniture-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
}

.furniture-name {
    font-weight: 600;
    color: #333;
    font-size: clamp(14px, 3vw, 16px);
    flex: 1;
}

.furniture-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    margin-right: 10px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.checkbox-group label {
    margin: 0;
    font-size: clamp(13px, 3vw, 14px);
    cursor: pointer;
    white-space: nowrap;
}

input[type="checkbox"] {
    width: 26px;
    height: 26px;
    cursor: pointer;
    flex-shrink: 0;
    appearance: none;
    -webkit-appearance: none;
    background: #fff;
    border: 2px solid #cfcfcf;
    border-radius: 6px;
    display: inline-block;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

input[type="checkbox"]:hover {
    border-color: rgba(53, 101, 80, 1);
    transform: scale(1.05);
}

input[type="checkbox"]:checked {
    background: rgba(53, 101, 80, 1);
    border-color: rgba(53, 101, 80, 1);
}

input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(53, 101, 80, 0.15);
    border-color: rgba(53, 101, 80, 1);
}

/* Draw checkmark */
input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 7px;
    top: 3px;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Increase clickable label area */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.checkbox-group label {
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
}

.size-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 10px;
}

.size-options.hidden {
    display: none;
}

.total-section {
    background: linear-gradient(135deg, rgba(53, 101, 80, 1) 0%, rgba(53, 101, 80, 0.9) 100%);
    color: white;
    padding: 25px 20px;
    text-align: center;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.total-label {
    font-size: clamp(14px, 3vw, 16px);
    margin-bottom: 5px;
}

.total-amount {
    font-size: clamp(32px, 8vw, 52px);
    font-weight: bold;
    margin: 10px 0;
    word-break: break-all;
}

.currency {
    font-size: clamp(20px, 5vw, 28px);
}

.btn {
    background: white;
    color: rgba(53, 101, 80, 1);
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: clamp(14px, 3vw, 16px);
    font-weight: 600;
    cursor: pointer;
    margin: 15px 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    max-width: 300px;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 120%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%) scale(0);
    border-radius: 50%;
    transition: transform 0.4s ease-out;
}

.btn:hover::after {
    transform: translate(-50%, -50%) scale(1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(53, 101, 80, 0.3);
}

.btn:active {
    transform: scale(0.98);
}

.btn-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.room-section {
    margin-bottom: 20px;
    padding: 18px;
    background: white;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

.room-title {
    font-size: clamp(16px, 4vw, 20px);
    color: rgba(53, 101, 80, 1);
    margin-bottom: 15px;
    font-weight: 600;
}

.dimension-input {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

/* Desktop optimizations */
@media (min-width: 768px) {
    body {
        padding: 30px;
    }

    .form-section {
        padding: 30px;
    }

    .header {
        padding: 40px;
    }

    .section {
        padding: 30px;
    }

    .furniture-header {
        margin-bottom: 12px;
    }

    .size-options {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .dimension-input {
        grid-template-columns: 1fr 1fr;
    }

    .btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }

    .total-section {
        padding: 35px 30px;
    }

    /* Two column layout for bedrooms on desktop */
    #bedroomContainer {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
        gap: 20px;
    }

    .btn-group {
        flex-wrap: nowrap;
    }

    .btn {
        width: auto;
        min-width: 200px;
    }
}

/* Large desktop optimizations */
@media (min-width: 1200px) {
    .container {
        max-width: 1400px;
    }

    #bedroomContainer {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile specific optimizations */
@media (max-width: 767px) {
    body {
        padding: 5px;
    }

    .container {
        border-radius: 12px;
    }

    .header-content {
        flex-direction: column;
        gap: 15px;
    }

    .company-logo {
        height: 60px;
    }

    .logo-container {
        order: -1;
    }

    .section {
        padding: 15px;
        margin-bottom: 15px;
    }

    .furniture-item {
        padding: 12px;
    }

    .furniture-header {
        flex-wrap: wrap;
    }

    input[type="checkbox"] {
        width: 20px;
        height: 20px;
    }

    .total-section {
        padding: 20px 15px;
    }

    .btn {
        padding: 16px 24px;
        font-size: 16px;
        margin: 10px 0;
    }

    /* Ensure text is readable on mobile */
    select, input[type="number"] {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    /* Mobile Property Type Dropdown */
    #propertyType {
        padding: 16px 50px 16px 45px;
        font-size: 16px;
        background-size: 14px, 18px;
        background-position: right 14px center, left 15px center;
    }

    label[for="propertyType"] {
        font-size: 16px;
        margin-bottom: 10px;
    }

    /* Mobile Property Type Visual Options */
    .property-type-options-display {
        padding: 12px;
        margin-top: 8px;
    }
    
    .property-type-visual-option {
        padding: 12px 14px;
        font-size: 14px;
        gap: 10px;
    }
    
    .property-type-options-title {
        font-size: 13px;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
    }

    .container {
        box-shadow: none;
    }

    .btn {
        display: none;
    }
}

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

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(53, 101, 80, 1);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

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

/* Section transition animation */
.section.animate-in {
    animation: slideIn 600ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    60% {
        transform: translateY(-5px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Floating total box - moves based on scroll and viewport */
.floating-total {
    position: fixed;
    right: 20px;
    bottom: 120px;
    background: linear-gradient(135deg, rgba(53, 101, 80, 0.95) 0%, rgba(53, 101, 80, 0.9) 100%);
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 8px 24px rgba(53, 101, 80, 0.3);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 160px;
    transition: transform 250ms ease, opacity 200ms ease;
    opacity: 0;
    pointer-events: none;
    border: 2px solid rgba(205, 242, 202, 0.8);
}

.floating-total.visible {
    opacity: 1;
    pointer-events: auto;
}

.floating-total.small {
    transform: scale(0.95);
}

.floating-label {
    font-size: 12px;
    color: rgba(205, 242, 202, 0.9);
    margin-bottom: 6px;
    font-weight: 500;
}

.floating-amount {
    font-size: 22px;
    font-weight: 700;
    color: white;
    transition: transform 0.3s ease, color 0.2s ease;
}

.floating-amount.updated {
    transform: scale(1.1);
    color: rgba(205, 242, 202, 1);
}

.floating-amount .currency {
    font-size: 16px;
}

/* Adjust floating total for mobile screens */
@media (max-width: 767px) {
    .floating-total {
        position: fixed;
        bottom: 20px;
        right: 20px;
        padding: 10px 14px;
        transform: scale(0.9);
        z-index: 1000;
        min-width: 130px;
    }

    .floating-amount {
        font-size: 18px;
    }

    .floating-amount .currency {
        font-size: 14px;
    }

    .floating-label {
        font-size: 11px;
    }
}

/* Slightly smaller floating on very large screens */
@media (min-width: 1400px) {
    .floating-total {
        right: 40px;
    }
}

/* Visual Options Display Styles */
.visual-options-display {
    margin-top: 10px;
    padding: 15px;
    background: linear-gradient(135deg, rgba(205, 242, 202, 0.1) 0%, rgba(53, 101, 80, 0.05) 100%);
    border: 2px solid rgba(53, 101, 80, 0.2);
    border-radius: 12px;
    animation: optionsSlideIn 0.4s ease-out;
}

@keyframes optionsSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 300px;
    }
}

.options-title {
    font-weight: 600;
    color: rgba(53, 101, 80, 1);
    margin-bottom: 10px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.visual-option {
    padding: 8px 12px;
    margin: 5px 0;
    background: white;
    border: 1px solid rgba(53, 101, 80, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    color: rgba(53, 101, 80, 0.9);
    position: relative;
    overflow: hidden;
}

.visual-option:hover {
    background: rgba(53, 101, 80, 0.1);
    border-color: rgba(53, 101, 80, 0.4);
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(53, 101, 80, 0.2);
}

.visual-option:active {
    transform: translateX(3px) scale(0.98);
}

.visual-option.selected {
    background: rgba(53, 101, 80, 1);
    color: white;
    border-color: rgba(53, 101, 80, 1);
    font-weight: 600;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(53, 101, 80, 0.3);
}

.visual-option.selected:before {
    content: "✓";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: bold;
    font-size: 16px;
}

/* Responsive adjustments for visual options */
@media (max-width: 767px) {
    .visual-options-display {
        padding: 12px;
        margin-top: 8px;
    }
    
    .visual-option {
        padding: 10px;
        font-size: 13px;
    }
    
    .options-title {
        font-size: 13px;
    }
}