/* ===== TRIP EDITOR STYLES ===== */

/* Editor Toolbar */
.editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.editor-toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.editor-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.editor-title-display {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.editor-dirty-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: #f59e0b;
    color: #000;
    font-weight: 600;
}

/* Editor Layout */
.editor-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 24px;
    min-height: 600px;
}

@media (max-width: 900px) {
    .editor-layout {
        grid-template-columns: 1fr;
    }
}

/* Sidebar */
.editor-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.editor-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
}

.editor-section-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* Cover Image */
.editor-cover-preview {
    width: 100%;
    height: 180px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg);
    margin-bottom: 8px;
    position: relative;
}

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

.editor-cover-preview .no-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: 13px;
}

/* Form Fields */
.editor-field {
    margin-bottom: 12px;
}

.editor-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.editor-field input,
.editor-field textarea,
.editor-field select {
    width: 100%;
    padding: 8px 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.editor-field input:focus,
.editor-field textarea:focus,
.editor-field select:focus {
    outline: none;
    border-color: var(--accent);
}

.editor-field textarea {
    resize: vertical;
    min-height: 60px;
}

.editor-field-row {
    display: flex;
    gap: 8px;
}

.editor-field-row .editor-field {
    flex: 1;
}

/* Tag Input */
.editor-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    min-height: 34px;
    align-items: center;
}

.editor-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--accent);
    color: #fff;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.editor-tag-remove {
    cursor: pointer;
    opacity: 0.7;
    font-size: 14px;
    line-height: 1;
}

.editor-tag-remove:hover {
    opacity: 1;
}

.editor-tag-input {
    border: none !important;
    background: transparent !important;
    padding: 2px 4px !important;
    min-width: 80px;
    flex: 1;
    font-size: 12px !important;
}

.editor-tag-input:focus {
    outline: none;
    border: none !important;
}

/* Main Content */
.editor-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Map Container */
.editor-map-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.editor-map-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.editor-map-header h3 {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
}

.editor-map {
    height: 350px;
    width: 100%;
    position: relative;
}

.editor-map-search {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    z-index: 10;
    max-width: 380px;
}

.editor-map-search input {
    width: 100%;
    padding: 10px 14px 10px 36px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #1e293b;
    font-family: var(--font, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.editor-map-search input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.editor-map-search input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1), 0 1px 4px rgba(0, 0, 0, 0.06);
}

/* Google Places Autocomplete dropdown — light theme */
.pac-container {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-top: none !important;
    border-radius: 0 0 8px 8px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08) !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
    z-index: 10000 !important;
    margin-top: -1px !important;
    padding: 4px 0 !important;
}

.pac-item {
    padding: 8px 14px !important;
    font-size: 13px !important;
    color: #1e293b !important;
    border-top: 1px solid #f1f5f9 !important;
    cursor: pointer !important;
    line-height: 1.4 !important;
    transition: background 0.1s !important;
}

.pac-item:first-child {
    border-top: none !important;
}

.pac-item:hover,
.pac-item-selected {
    background: #f1f5f9 !important;
}

.pac-item-query {
    font-size: 13px !important;
    color: #1e293b !important;
    font-weight: 600 !important;
}

.pac-matched {
    color: #6366f1 !important;
    font-weight: 700 !important;
}

.pac-icon {
    margin-top: 2px !important;
}

.pac-logo::after {
    margin: 4px 8px !important;
}

.editor-map-search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #94a3b8;
    pointer-events: none;
}

/* Map wrapper — holds both map and overlaying exit button */
.editor-map-wrapper {
    position: relative;
}

/* Street View exit button — sits outside the map div so Street View can't cover it */
.editor-map-exit-sv {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 999;
    display: none;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: #ffffff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: var(--font, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    transition: background 0.15s, box-shadow 0.15s;
}

.editor-map-exit-sv:hover {
    background: #f1f5f9;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.editor-map-exit-sv.visible {
    display: inline-flex;
}

/* Day Cards */
.editor-day-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.editor-day-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(99, 102, 241, 0.05);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.editor-day-header:hover {
    background: rgba(99, 102, 241, 0.1);
}

.editor-day-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.editor-day-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.editor-day-title-input {
    background: transparent !important;
    border: 1px solid transparent !important;
    padding: 4px 6px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--text) !important;
    border-radius: 4px;
}

.editor-day-title-input:focus {
    border-color: var(--accent) !important;
    background: var(--bg) !important;
}

.editor-day-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.editor-day-body {
    padding: 12px 16px;
}

/* Stop Cards */
.editor-stop-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    margin-bottom: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.editor-stop-card:hover {
    border-color: var(--accent);
}

.editor-stop-card.dragging {
    opacity: 0.5;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.editor-stop-drag {
    cursor: grab;
    color: var(--text-muted);
    font-size: 16px;
    padding: 4px;
    flex-shrink: 0;
    user-select: none;
}

.editor-stop-drag:active {
    cursor: grabbing;
}

.editor-stop-content {
    flex: 1;
    min-width: 0;
}

.editor-stop-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.editor-stop-category {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

.editor-stop-category.cat-attraction { background: #10b981; color: #fff; }
.editor-stop-category.cat-activity { background: #f59e0b; color: #000; }
.editor-stop-category.cat-accommodation { background: #6366f1; color: #fff; }
.editor-stop-category.cat-transport { background: #06b6d4; color: #fff; }

.editor-stop-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.editor-stop-desc {
    font-size: 12px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 4px;
}

.editor-stop-images-row {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
}

.editor-stop-thumb {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid var(--border);
}

.editor-stop-thumb-add {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    border: 1px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    transition: border-color 0.15s;
}

.editor-stop-thumb-add:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.editor-stop-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

/* Add Stop Button */
.editor-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    width: 100%;
    margin-top: 4px;
}

.editor-add-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(99, 102, 241, 0.05);
}

/* Stop Detail Modal */
.editor-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.editor-modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 680px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
}

.editor-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.editor-modal-header h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

.editor-modal-body {
    padding: 20px;
}

.editor-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

/* Image Manager */
.editor-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.editor-image-item {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    aspect-ratio: 1;
    border: 2px solid transparent;
    cursor: pointer;
}

.editor-image-item.is-cover {
    border-color: var(--accent);
}

.editor-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.editor-image-item-actions {
    position: absolute;
    top: 4px;
    right: 4px;
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.15s;
}

.editor-image-item:hover .editor-image-item-actions {
    opacity: 1;
}

.editor-image-item-btn {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
}

.editor-image-item-btn.btn-cover {
    background: var(--accent);
    color: #fff;
}

.editor-image-item-btn.btn-remove {
    background: #ef4444;
    color: #fff;
}

.editor-image-cover-label {
    position: absolute;
    bottom: 4px;
    left: 4px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--accent);
    color: #fff;
    padding: 1px 5px;
    border-radius: 3px;
}

/* Upload Dropzone */
.editor-upload-zone {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    margin-top: 8px;
}

.editor-upload-zone:hover,
.editor-upload-zone.drag-over {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(99, 102, 241, 0.05);
}

.editor-upload-zone input[type="file"] {
    display: none;
}

/* Booking Section */
.editor-booking-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.editor-supplier-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-bottom: 4px;
    cursor: pointer;
    font-size: 12px;
}

.editor-supplier-result:hover {
    border-color: var(--accent);
}

/* DB Trips List */
.editor-trips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.editor-trip-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.1s;
}

.editor-trip-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.editor-trip-card-image {
    height: 140px;
    background: var(--bg);
    overflow: hidden;
}

.editor-trip-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.editor-trip-card-body {
    padding: 12px 16px;
}

.editor-trip-card-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.editor-trip-card-meta {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

/* Icon Buttons */
.editor-icon-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s;
}

.editor-icon-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.editor-icon-btn.danger:hover {
    border-color: #ef4444;
    color: #ef4444;
}

/* Save button */
.btn-save {
    background: #10b981;
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-save:hover {
    background: #059669;
}

.btn-save:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Section Divider */
.editor-divider {
    height: 1px;
    background: var(--border);
    margin: 12px 0;
}

/* Map Legend */
.editor-map-legend {
    padding: 8px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 11px;
    color: var(--text-muted);
}

.editor-map-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.editor-map-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
