/* Swiss Flats Simple Search - Complementary to ElevenLabs */

:root {
    --sfs-primary: #ef4444;
    --sfs-primary-hover: #dc2626;
    --sfs-white: #ffffff;
    --sfs-gray-50: #f9fafb;
    --sfs-gray-100: #f3f4f6;
    --sfs-gray-200: #e5e7eb;
    --sfs-gray-500: #6b7280;
    --sfs-gray-900: #111827;
    --sfs-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --sfs-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Main widget container */
#sfs-widget {
    position: fixed;
    z-index: 999997; /* Below ElevenLabs but above most content */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

/* Positioning options */
#sfs-widget.sfs-position-bottom-left {
    bottom: 24px;
    left: 24px;
}

#sfs-widget.sfs-position-bottom-right-offset {
    bottom: 24px;
    right: 100px; /* Offset from ElevenLabs widget */
}

#sfs-widget.sfs-position-top-right {
    top: 24px;
    right: 24px;
}

/* Tray button */
.sfs-tray-btn {
    width: 56px;
    height: 56px;
    background: var(--sfs-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--sfs-shadow-lg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    position: relative;
    overflow: hidden;
}

.sfs-tray-btn:hover {
    background: var(--sfs-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 25px 30px -5px rgba(0, 0, 0, 0.15);
}

.sfs-tray-btn:active {
    transform: translateY(0);
}

.sfs-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    filter: brightness(0) invert(1); /* Make logo white */
}

/* Modal overlay */
.sfs-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999998;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    animation: sfs-fade-in 0.3s ease-out;
}

.sfs-modal-content {
    background: var(--sfs-white);
    border-radius: 16px;
    box-shadow: var(--sfs-shadow-lg);
    width: 100%;
    max-width: 400px;
    max-height: 80vh;
    overflow: hidden;
    animation: sfs-slide-up 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    margin: 20px;
}

/* Modal header */
.sfs-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--sfs-gray-200);
    background: var(--sfs-gray-50);
}

.sfs-modal-header h3 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 16px;
    color: var(--sfs-gray-900);
    margin: 0;
}

.sfs-header-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.sfs-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 500;
    color: var(--sfs-gray-500);
    transition: all 0.2s;
}

.sfs-close:hover {
    background: var(--sfs-gray-200);
    color: var(--sfs-gray-900);
}

/* Modal body */
.sfs-modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

/* Form styles */
.sfs-form-group {
    margin-bottom: 20px;
}

.sfs-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--sfs-gray-900);
    font-size: 14px;
}

.sfs-form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--sfs-gray-200);
    border-radius: 12px;
    background: var(--sfs-white);
    color: var(--sfs-gray-900);
    font-size: 14px;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

.sfs-form-group select:focus {
    outline: none;
    border-color: var(--sfs-primary);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Search button */
.sfs-search-submit {
    width: 100%;
    padding: 14px 20px;
    background: var(--sfs-primary);
    color: var(--sfs-white);
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sfs-search-submit:hover {
    background: var(--sfs-primary-hover);
    transform: translateY(-1px);
}

.sfs-search-submit:active {
    transform: translateY(0);
}

.sfs-search-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Secondary button */
.sfs-secondary-btn {
    padding: 8px 16px;
    background: var(--sfs-gray-100);
    color: var(--sfs-gray-900);
    border: 1px solid var(--sfs-gray-200);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.sfs-secondary-btn:hover {
    background: var(--sfs-gray-200);
}

/* Results section */
.sfs-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--sfs-gray-200);
}

.sfs-results-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--sfs-gray-900);
}

/* Property cards */
.sfs-property-card {
    background: var(--sfs-gray-50);
    border: 1px solid var(--sfs-gray-200);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    transition: all 0.2s;
    cursor: pointer;
}

.sfs-property-card:hover {
    border-color: var(--sfs-primary);
    box-shadow: var(--sfs-shadow);
    transform: translateY(-2px);
}

.sfs-property-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 12px;
}

.sfs-property-image {
    width: 80px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--sfs-gray-200);
}

.sfs-property-info {
    flex: 1;
}

.sfs-property-title {
    font-weight: 600;
    font-size: 16px;
    color: var(--sfs-gray-900);
    margin: 0 0 4px 0;
}

.sfs-property-price {
    font-weight: 700;
    font-size: 18px;
    color: var(--sfs-primary);
    margin: 0;
}

.sfs-property-details {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--sfs-gray-500);
}

.sfs-property-description {
    color: var(--sfs-gray-500);
    font-size: 14px;
    margin: 0 0 12px 0;
}

.sfs-property-amenities {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.sfs-amenity-tag {
    background: rgba(239, 68, 68, 0.1);
    color: var(--sfs-primary);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

/* Animations */
@keyframes sfs-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes sfs-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    #sfs-widget.sfs-position-bottom-left,
    #sfs-widget.sfs-position-bottom-right-offset {
        bottom: 16px;
        left: 16px;
    }
    
    #sfs-widget.sfs-position-top-right {
        top: 16px;
        right: 16px;
    }
    
    .sfs-modal-content {
        margin: 16px;
        max-height: 85vh;
    }
    
    .sfs-modal-header {
        padding: 16px 20px 12px;
    }
    
    .sfs-modal-body {
        padding: 20px;
    }
    
    .sfs-property-header {
        flex-direction: column;
        gap: 12px;
    }
    
    .sfs-property-image {
        width: 100%;
        height: 120px;
    }
    
    .sfs-property-details {
        flex-direction: column;
        gap: 8px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --sfs-white: #1f2937;
        --sfs-gray-50: #374151;
        --sfs-gray-100: #4b5563;
        --sfs-gray-200: #6b7280;
        --sfs-gray-500: #9ca3af;
        --sfs-gray-900: #f9fafb;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print styles */
@media print {
    #sfs-widget {
        display: none !important;
    }
}

