/* Add Listing Form Styles */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #fff;
    color: #1f2937;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Google Maps Customization */
#map {
    height: 400px;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    z-index: 1;
}

/* Google Maps Info Window */
.gm-style .gm-style-iw-c {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
    border-radius: 12px !important;
}

.gm-style .gm-style-iw-d {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

/* PAC (Places Autocomplete) Container Styling */
.pac-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    margin-top: 4px;
    z-index: 10000 !important;
}

.pac-item {
    padding: 12px 16px;
    border: none;
    font-size: 14px;
    line-height: 1.5;
    cursor: pointer;
    transition: background 0.2s;
}

.pac-item:hover {
    background: #f9fafb;
}

.pac-item-query {
    font-weight: 600;
    color: #1f2937;
}

.pac-matched {
    font-weight: 700;
    color: #2563eb;
}

.pac-icon {
    display: none;
}

.pac-item-selected {
    background: #f3f4f6;
}

.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.leaflet-popup-content {
    margin: 12px 16px;
    font-size: 14px;
}

/* Map marker icon customization */
.leaflet-marker-icon {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

/* Header */
.form-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 72px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 100;
}

.header-logo {
    font-size: clamp(1.15rem, 2.5vw, 1.5rem);
    font-weight: 800;
    color: #dc2626;
    text-decoration: none;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.progress-steps {
    display: flex;
    gap: 0;
}

.step {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 0.85rem;
    font-weight: 500;
    position: relative;
}

.step:first-child {
    border-radius: 25px 0 0 25px;
}

.step:last-child {
    border-radius: 0 25px 25px 0;
}

.step.active {
    background: #dc2626;
    color: #fff;
}

.step.completed {
    background: #10b981;
    color: #fff;
}

.step.completed .step-number::before {
    content: '✓';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.step-number {
    margin-right: 0.5rem;
    font-weight: 600;
}

.save-exit-btn {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
}

.save-exit-btn:hover {
    color: #374151;
}

/* Main Content */
.form-main {
    flex: 1;
    padding: 100px 0 120px;
    overflow: visible;
}

.form-step {
    display: none;
    overflow: visible;
}

.form-step.active {
    display: block;
    overflow: visible;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-row.three-col {
    grid-template-columns: 1fr 1fr 1fr;
}

/* Form Groups */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.required {
    color: #ef4444;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fff;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #dc2626;
}

.form-group input::placeholder {
    color: #9ca3af;
}

.form-group input[readonly] {
    background: #f9fafb;
    color: #6b7280;
}

/* Error states */
.form-group.has-error label {
    color: #ef4444;
}

.field-error,
.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error .select-trigger,
.form-group.has-error .rich-editor,
.form-group.has-error .location-input input {
    border-color: #ef4444 !important;
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Input with suffix */
.input-with-suffix {
    position: relative;
}

.input-with-suffix input {
    padding-right: 3rem;
}

.input-with-suffix .suffix {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 0.9rem;
}

/* Location input */
.location-input-wrapper {
    position: relative;
}

.location-input {
    position: relative;
    display: flex;
    align-items: center;
}

.location-input > svg:first-child {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    z-index: 1;
}

.location-input input {
    width: 100%;
    padding: 0.875rem 2.5rem 0.875rem 2.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fff;
    transition: border-color 0.2s;
}

.location-input input:focus {
    outline: none;
    border-color: #dc2626;
}

.location-input .dropdown-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
}

.location-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-top: 4px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    z-index: 100;
    display: none;
    max-height: 300px;
    overflow-y: auto;
}

.location-dropdown.active {
    display: block;
}

.location-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #374151;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.2s;
}

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

.location-item:hover {
    background: #f3f4f6;
}

.location-item svg {
    color: #6b7280;
    flex-shrink: 0;
}

.location-item.no-result {
    color: #9ca3af;
    cursor: default;
}

.location-item.no-result:hover {
    background: transparent;
}

/* Custom Select */
.custom-select {
    position: relative;
}

.select-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    background: #fff;
}

.select-trigger:hover {
    border-color: #d1d5db;
}

.select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-top: 4px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    z-index: 50;
    display: none;
    max-height: 300px;
    overflow-y: auto;
}

.select-dropdown.active {
    display: block;
}

.dropdown-search {
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.9rem;
}

.dropdown-search:focus {
    outline: none;
}

.option-group {
    border-bottom: 1px solid #f3f4f6;
}

.option-header {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #6b7280;
    background: #f9fafb;
}

.option {
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.option:hover {
    background: #f3f4f6;
}

/* Rich Editor */
.rich-editor {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.editor-toolbar {
    display: flex;
    gap: 0.25rem;
    padding: 0.5rem;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.editor-toolbar button {
    width: 32px;
    height: 32px;
    border: none;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #374151;
}

.editor-toolbar button:hover {
    background: #e5e7eb;
}

.editor-content {
    min-height: 200px;
    padding: 1rem;
    outline: none;
}

.editor-content:empty::before {
    content: attr(placeholder);
    color: #9ca3af;
}

.char-count {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #ef4444;
}

/* Map Container */
.map-container {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

/* Accordion */
.accordion-section {
    margin-bottom: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: visible;
}

.accordion-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border: none;
    background: #fff;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    text-align: left;
}

.accordion-icon {
    font-size: 1.25rem;
}

.accordion-arrow {
    margin-left: auto;
    transition: transform 0.2s;
}

.accordion-header.active .accordion-arrow {
    transform: rotate(180deg);
}

.optional-badge {
    padding: 0.25rem 0.75rem;
    background: #f3f4f6;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
}

.accordion-content {
    display: none;
    padding: 0 1.5rem 1.5rem;
}

.accordion-content.active {
    display: block;
}

/* Upload Section */
.upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1.5fr;
    gap: 1.5rem;
}

.upload-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
}

.upload-card.wide {
    grid-column: span 1;
}

.upload-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.upload-desc {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 1rem;
}

.upload-preview {
    height: 160px;
    background: #f9fafb;
    border: 1px dashed #e5e7eb;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    margin-bottom: 1rem;
}

.upload-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.upload-preview svg {
    margin-bottom: 0.5rem;
}

.upload-area {
    padding: 1.5rem;
    border: 1px dashed #e5e7eb;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-area:hover {
    border-color: #dc2626;
    background: #f9fafb;
}

.upload-area svg {
    margin-bottom: 0.5rem;
    color: #6b7280;
}

.upload-area span {
    display: block;
    font-size: 0.9rem;
    color: #374151;
    margin-bottom: 0.25rem;
}

.upload-area small {
    font-size: 0.8rem;
    color: #9ca3af;
}

/* Gallery Upload */
.gallery-slots {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.gallery-slot {
    aspect-ratio: 1;
    background: #f9fafb;
    border: 1px dashed #e5e7eb;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 1.5rem;
}

.gallery-slot.filled {
    border-style: solid;
}

.gallery-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* Preview Section */
.preview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.preview-grid.preview-grid-single {
    grid-template-columns: 1fr;
}

.ai-section,
.preview-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
}

.ai-header,
.preview-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.ai-icon,
.preview-icon {
    font-size: 1.5rem;
}

.ai-header h3,
.preview-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.ai-header p,
.preview-header p {
    font-size: 0.85rem;
    color: #6b7280;
}

.ai-actions {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.ai-note {
    flex-basis: 100%;
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

/* Preview Cards */
.preview-cards {
    margin-bottom: 1.5rem;
}

.preview-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.preview-image {
    height: 140px;
    background: #f3f4f6;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.preview-info {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.preview-type,
.preview-category {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    background: #f3f4f6;
    color: #6b7280;
}

.preview-card h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.preview-location {
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.preview-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f2937;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background: #dc2626;
    color: #fff;
    transition: all 0.2s;
}

.btn-primary:hover:not(.disabled) {
    background: #003d6e;
}

.btn-primary.disabled,
.btn-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-primary.disabled:hover,
.btn-primary:disabled:hover {
    background: #9ca3af;
}

.btn-secondary {
    background: #fff;
    color: #000000;
    border: 1px solid #000000;
}

.btn-secondary:hover {
    background: #fff5f2;
}

.btn-outline {
    background: #fff;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.btn-outline:hover {
    border-color: #d1d5db;
}

.btn-back {
    background: none;
    border: none;
    color: #6b7280;
    padding: 0;
}

.btn-back:hover {
    color: #374151;
}

.btn-preview {
    width: 100%;
    background: #fff;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.btn-preview:hover {
    border-color: #dc2626;
    color: #dc2626;
}

/* Footer */
.form-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    z-index: 100;
}

/* Custom Date Picker */
.custom-date-picker {
    position: relative;
}

.date-input {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.date-input:hover {
    border-color: #dc2626;
    background: #fff;
}

.date-input svg:first-child {
    color: #6b7280;
}

.date-input span {
    flex: 1;
    color: #9ca3af;
    font-size: 0.95rem;
}

.date-input .dropdown-icon {
    color: #9ca3af;
    transition: transform 0.2s;
}

.date-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    display: none;
    z-index: 10000;
    width: 100%;
    min-width: 320px;
}

.date-dropdown.active {
    display: block;
}

.date-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.date-picker-header button {
    background: #f9fafb;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 1.25rem;
    color: #374151;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.date-picker-header button:hover {
    background: #dc2626;
    color: #fff;
}

.date-picker-header span {
    font-weight: 600;
    font-size: 1.1rem;
    color: #1f2937;
}

.month-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.month-item {
    padding: 1rem 0.5rem;
    text-align: center;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: #374151;
    transition: all 0.2s;
    background: #f9fafb;
    border: 1px solid transparent;
}

.month-item:hover {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 78, 137, 0.2);
}

.month-item.selected {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}

/* Footer */
.form-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    z-index: 100;
}

.form-footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 24px;
}

.footer-right {
    display: flex;
    gap: 1rem;
    margin-left: auto;
}

.progress-bar {
    height: 4px;
    background: #e5e7eb;
}

.progress-fill {
    height: 100%;
    background: #dc2626;
    transition: width 0.3s;
}

/* Responsive */
@media (max-width: 1024px) {
    .progress-steps {
        display: none;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .upload-grid {
        grid-template-columns: 1fr;
    }
    
    .preview-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .form-header {
        padding: 0 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-row.three-col {
        grid-template-columns: 1fr;
    }
    
    .gallery-slots {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-footer .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .footer-right {
        width: 100%;
        justify-content: center;
    }
}
