/* ========================================
   Expedition Editor Modal
   ======================================== */

/* Modal Overlay */
.expedition-editor-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2500;
    opacity: 0;
    transition: opacity 0.3s ease;
    justify-content: center;
    align-items: center;
}

.expedition-editor-modal.open {
    opacity: 1;
}

/* Editor Content Container */
.expedition-editor-content {
    background: #1a1a1a;
    border: 3px solid #e94560;
    border-radius: 12px;
    width: 90%;
    max-width: none;
    height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: editorSlideIn 0.3s ease-out;
}

@keyframes editorSlideIn {
    from {
        transform: scale(0.9) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Header */
.expedition-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 2px solid #e94560;
    background: rgba(233, 69, 96, 0.1);
}

.expedition-editor-header h2 {
    margin: 0;
    color: #e94560;
    font-size: 1.5rem;
}

.close-btn {
    background: none;
    border: 2px solid #e94560;
    color: #e94560;
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-btn:hover {
    background: #e94560;
    color: #fff;
    transform: rotate(90deg);
}

/* Tabs */
.expedition-editor-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #222;
    border-bottom: 1px solid #444;
}

.editor-tab {
    padding: 0.75rem 1.5rem;
    background: rgba(233, 69, 96, 0.1);
    border: 1px solid rgba(233, 69, 96, 0.3);
    border-radius: 6px;
    color: #aaa;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.editor-tab:hover {
    background: rgba(233, 69, 96, 0.2);
    border-color: rgba(233, 69, 96, 0.5);
}

.editor-tab.active {
    background: rgba(233, 69, 96, 0.3);
    border-color: #e94560;
    color: #e94560;
    box-shadow: 0 0 8px rgba(233, 69, 96, 0.4);
}

/* Body */
.expedition-editor-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    padding: 1.5rem;
}

.editor-tab-content {
    width: 100%;
    overflow-y: auto;
}

/* Two-Column Layout (List + Form) */
.editor-two-col {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 1.5rem;
    height: 100%;
}

/* Item List */
.editor-list {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #444;
    border-radius: 8px;
    padding: 1rem;
    overflow-y: auto;
}

.editor-list-item {
    padding: 0.75rem;
    background: rgba(233, 69, 96, 0.05);
    border: 1px solid rgba(233, 69, 96, 0.2);
    border-radius: 6px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.editor-list-item:hover {
    background: rgba(233, 69, 96, 0.15);
    border-color: rgba(233, 69, 96, 0.4);
    transform: translateX(5px);
}

.editor-list-item.selected {
    background: rgba(233, 69, 96, 0.25);
    border-color: #e94560;
    box-shadow: 0 0 8px rgba(233, 69, 96, 0.4);
}

.editor-list-item-title {
    font-size: 1rem;
    color: #e0e0e0;
    margin-bottom: 0.25rem;
}

.editor-list-item-subtitle {
    font-size: 0.85rem;
    color: #888;
}

/* Form Panel */
.editor-form {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #444;
    border-radius: 8px;
    padding: 1.5rem;
    overflow-y: auto;
}

.editor-form-section {
    margin-bottom: 1.5rem;
}

.editor-form-section h3 {
    color: #e94560;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

/* Form Inputs */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    color: #ccc;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #444;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #e94560;
    box-shadow: 0 0 8px rgba(233, 69, 96, 0.3);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

/* Checkbox */
.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
}

/* Buttons */
.editor-form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #444;
}

.btn-editor {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.btn-editor-save {
    background: #2ecc71;
    color: #fff;
}

.btn-editor-save:hover {
    background: #27ae60;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.4);
}

.btn-editor-delete {
    background: #e74c3c;
    color: #fff;
}

.btn-editor-delete:hover {
    background: #c0392b;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

.btn-editor-new {
    background: #e94560;
    color: #fff;
}

.btn-editor-new:hover {
    background: #ff5577;
    box-shadow: 0 4px 12px rgba(233, 69, 96, 0.4);
}

.btn-editor-cancel {
    background: rgba(233, 69, 96, 0.1);
    border: 1px solid rgba(233, 69, 96, 0.3);
    color: #ccc;
}

.btn-editor-cancel:hover {
    background: rgba(233, 69, 96, 0.2);
    border-color: rgba(233, 69, 96, 0.5);
}

/* Empty State */
.editor-empty-state {
    text-align: center;
    padding: 3rem;
    color: #888;
}

.editor-empty-state h3 {
    color: #ccc;
    margin-bottom: 0.5rem;
}

/* Tools Grid */
.editor-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.editor-tool-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #444;
    border-radius: 8px;
    padding: 1.5rem;
}

.editor-tool-card h4 {
    color: #e94560;
    margin-bottom: 0.75rem;
}

.editor-tool-card p {
    color: #aaa;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Choice Items (Events Tab) */
.choice-item {
    background: rgba(233, 69, 96, 0.05);
    border: 1px solid rgba(233, 69, 96, 0.2);
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.choice-item label {
    display: block;
    margin-bottom: 0.25rem;
}

.choice-item input {
    width: 100%;
}

/* State Viewer (State Tab) */
.state-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-left: 1rem;
    border-left: 2px solid rgba(233, 69, 96, 0.2);
}

.state-item {
    display: flex;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-family: 'Courier New', monospace;
}

.state-key {
    color: #e94560;
    font-weight: 600;
    min-width: 180px;
}

.state-value {
    color: #aaa;
    flex: 1;
}

.state-value .state-list {
    margin-top: 0.5rem;
}

/* ========================================
   Events Tab Layout
   ======================================== */

/* Three-column layout for Events Tab */
.editor-events-layout {
    display: grid;
    grid-template-columns: 250px 350px 1fr;
    gap: 1.5rem;
    height: 100%;
}

/* Column 1: Navigation (Destination + Zones) */
.editor-events-nav {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #444;
    border-radius: 8px;
    padding: 1rem;
    overflow-y: auto;
}

.editor-events-nav .form-group {
    margin-bottom: 1rem;
}

/* Zone Items */
.zone-item {
    padding: 0.5rem;
    background: rgba(233, 69, 96, 0.05);
    border: 1px solid rgba(233, 69, 96, 0.2);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.zone-item:hover {
    background: rgba(233, 69, 96, 0.15);
    border-color: rgba(233, 69, 96, 0.4);
    transform: translateX(3px);
}

.zone-item.selected {
    background: rgba(233, 69, 96, 0.25);
    border-color: #e94560;
    box-shadow: 0 0 8px rgba(233, 69, 96, 0.4);
}

.zone-event-count {
    color: #888;
    font-size: 0.85rem;
}

/* Destination Events Button (in Destinations Tab) */
.destination-events-btn {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    padding: 0.3rem 0.75rem;
    width: auto;
}

/* Choice Items (Event Form) */
.choice-item {
    background: rgba(233, 69, 96, 0.05);
    border: 1px solid rgba(233, 69, 96, 0.2);
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.choice-item:hover {
    background: rgba(233, 69, 96, 0.1);
    border-color: rgba(233, 69, 96, 0.3);
}

/* Exit Items (Event List) */
.exit-item {
    padding: 0.75rem;
    background: rgba(52, 152, 219, 0.05);
    border: 1px solid rgba(52, 152, 219, 0.2);
    border-radius: 6px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.exit-item:hover {
    background: rgba(52, 152, 219, 0.15);
    border-color: rgba(52, 152, 219, 0.4);
    transform: translateX(5px);
}
