/**
 * Radzen Custom Dropdown Styles
 * Custom dropdown component with search, scrollbar, and modal integration
 * Also includes Add Story Modal split layout styles
 */

/* Radzen Custom Dropdown */
.rz-custom-dropdown {
    position: relative;
    width: 100%;
}

.rz-dropdown-button {
    width: 100%;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--rz-border, #dee2e6);
    border-radius: var(--rz-border-radius, 4px);
    background-color: var(--rz-surface, #fff);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--rz-shadow-1, 0 1px 2px rgba(0,0,0,0.05));
    text-align: left;
}

.rz-dropdown-button:hover {
    border-color: var(--rz-primary, #0078d4);
    box-shadow: 0 2px 6px rgba(0, 120, 212, 0.15);
}

.rz-dropdown-button:focus {
    outline: none;
    border-color: var(--rz-primary, #0078d4);
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

.rz-dropdown-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rz-dropdown-icon {
    margin-left: 0.5rem;
    font-size: 0.8rem;
    color: var(--rz-text-secondary, #6c757d);
    transition: transform 0.2s ease;
}

.rz-dropdown-button[aria-expanded="true"] .rz-dropdown-icon {
    transform: rotate(180deg);
}

.rz-dropdown-panel {
    position: fixed;
    z-index: 10000;
    background: var(--rz-surface, #fff);
    border: 1px solid var(--rz-border, #dee2e6);
    border-radius: var(--rz-border-radius, 4px);
    box-shadow: var(--rz-shadow-3, 0 4px 8px rgba(0,0,0,0.1));
    max-height: 300px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 300px;
}

.rz-dropdown-search {
    padding: 0.5rem;
    border-bottom: 1px solid var(--rz-border, #dee2e6);
}

.rz-search-input {
    width: 100%;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--rz-border, #dee2e6);
    border-radius: var(--rz-border-radius-sm, 2px);
    font-size: 0.9rem;
}

.rz-search-input:focus {
    outline: none;
    border-color: var(--rz-primary, #0078d4);
}

.rz-dropdown-items {
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 250px;
    -webkit-overflow-scrolling: touch;
}

.rz-dropdown-items::-webkit-scrollbar {
    width: 8px;
}

.rz-dropdown-items::-webkit-scrollbar-track {
    background: var(--rz-border-light, #f3f4f6);
    border-radius: 4px;
}

.rz-dropdown-items::-webkit-scrollbar-thumb {
    background: var(--rz-text-secondary, #6c757d);
    border-radius: 4px;
}

.rz-dropdown-items::-webkit-scrollbar-thumb:hover {
    background: var(--rz-primary, #0078d4);
}

.rz-dropdown-item {
    padding: 0.6rem 0.75rem;
    cursor: pointer;
    transition: background-color 0.15s ease;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--rz-border-light, #f3f4f6);
}

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

.rz-dropdown-item:hover {
    background-color: var(--rz-primary-light, rgba(0, 120, 212, 0.08));
}

.rz-dropdown-item.selected {
    background-color: var(--rz-primary, #0078d4);
    color: white;
}

.rz-dropdown-item-empty {
    padding: 1.5rem;
    text-align: center;
    color: var(--rz-text-secondary, #6c757d);
    font-style: italic;
}

/* 1. MODAL RESET & LAYOUT */
#addStoryModal .modal-dialog.modal-fullscreen {
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
}

#addStoryModal .modal-content {
    height: 100%;
    border: none;
    border-radius: 0;
    display: flex;
    flex-direction: column;
}

#addStoryModal .modal-body {
    padding: 0 !important;
    overflow: hidden !important;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 2. SPLIT CONTAINER (The Fix) */
.add-story-container {
    display: flex !important;
    flex-direction: row !important;
    width: 100%;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* 3. LEFT COLUMN (Form) - 65% */
.form-column {
    flex: 0 0 65%;
    max-width: 65%;
    height: 100%;
    overflow-y: auto;
    padding: 2rem 3rem;
    border-right: 1px solid #e5e7eb;
    background: #fff;
}

/* 4. RIGHT COLUMN (Preview) - 35% */
.preview-column {
    flex: 0 0 35%;
    max-width: 35%;
    height: 100%;
    overflow-y: auto;
    padding: 2rem;
    background: #f8f9fa;
}

/* 5. RESPONSIVE (Mobile) */
@media (max-width: 991px) {
    .add-story-container {
        flex-direction: column !important;
        overflow-y: auto;
    }

    .form-column,
    .preview-column {
        flex: 0 0 auto;
        max-width: 100%;
        width: 100%;
        height: auto;
        overflow-y: visible;
    }

    .preview-column {
        border-top: 1px solid #e5e7eb;
    }
}

/* 6. COMPONENT STYLING */
.section-title {
    font-size: 1.1rem; font-weight: 600; color: #111827;
    margin-bottom: 1.5rem; padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

/* Preview Card */
.preview-sticky { position: sticky; top: 0; }
.preview-story-card {
    background: white; border: 1px solid #e5e7eb; border-radius: 8px;
    overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.1); margin-bottom: 1.5rem;
}
.preview-card-image {
    width: 100%; height: 180px; background: #f3f4f6;
    display: flex; align-items: center; justify-content: center;
    color: #9ca3af; font-size: 3rem;
}
.preview-card-image img { width: 100%; height: 100%; object-fit: cover; }
.preview-card-info { padding: 1.25rem; }
.preview-card-title { font-size: 1rem; font-weight: 600; color: #111827; margin: 0 0 0.75rem 0; }
.preview-card-location { font-size: 0.875rem; color: #6b7280; display: flex; align-items: center; gap: 0.375rem; }
.preview-card-footer { padding: 0.875rem 1.25rem; border-top: 1px solid #e5e7eb; font-size: 0.8125rem; color: #6b7280; }

/* Form Inputs */
#addStoryModal .form-control:focus,
#addStoryModal .form-select:focus {
    border-color: #0969da; box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.1);
}

.photo-upload-zone {
    border: 2px dashed #d1d5db; border-radius: 8px; padding: 2rem;
    text-align: center; cursor: pointer; background: #f9fafb;
    transition: 0.2s;
}
.photo-upload-zone:hover { border-color: #0969da; background: #eff6ff; }
.photo-preview img { max-width: 100%; border-radius: 8px; margin-top: 1rem; }

.form-step { display: none; }
.form-step.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* Search Results */
.search-results-dropdown {
    position: absolute; width: 100%; background: white;
    border: 1px solid #d1d5db; border-top: none;
    max-height: 200px; overflow-y: auto; z-index: 1050;
    border-radius: 0 0 6px 6px; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.search-result-item { padding: 8px 12px; cursor: pointer; border-bottom: 1px solid #f3f4f6; }
.search-result-item:hover { background-color: #f9fafb; }
.search-result-item strong { display: block; }
.search-result-item div { white-space: nowrap; }
.search-result-item span, .search-result-item small { display: inline; }

/* Tips Card */
.tips-card { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; padding: 1.25rem; }
.tips-card h6 { font-size: 0.9375rem; font-weight: 600; color: #1e40af; margin-bottom: 0.75rem; }
.tips-card ul { margin: 0; padding-left: 1.25rem; }
.tips-card li { font-size: 0.8125rem; color: #1e40af; margin-bottom: 0.5rem; }

/* Required field indicator */
.form-label.required-field::after { content: '*'; color: #dc2626; margin-left: 0.25rem; }

/* Quill Editor */
.quill-editor { background: white; border-radius: 6px; }
.quill-editor .ql-container { min-height: 200px; font-size: 0.9375rem; }
