/* Dialog System Styles */
.dialog-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.dialog-backdrop.dialog-visible {
    opacity: 1;
}

.dialog-backdrop.dialog-closing {
    opacity: 0;
}

.dialog-box {
    background: #1a1a1a;
    border: 2px solid #00ff88;
    border-radius: 12px;
    min-width: 320px;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 255, 136, 0.2);
    transform: scale(0.9);
    transition: transform 0.2s ease;
    animation: dialogSlideIn 0.2s ease forwards;
}

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

.dialog-closing .dialog-box {
    animation: dialogSlideOut 0.2s ease forwards;
}

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

.dialog-header {
    padding: 20px 24px 12px;
    border-bottom: 1px solid rgba(0, 255, 136, 0.2);
}

.dialog-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #00ff88;
}

.dialog-body {
    padding: 20px 24px;
}

.dialog-body p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

.dialog-input {
    width: 100%;
    padding: 10px 12px;
    margin-top: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.dialog-input:focus {
    outline: none;
    border-color: #00ff88;
    background: rgba(255, 255, 255, 0.08);
}

.dialog-footer {
    padding: 12px 24px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.dialog-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dialog-btn-primary {
    background: #00ff88;
    color: #000;
}

.dialog-btn-primary:hover {
    background: #00dd77;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 255, 136, 0.3);
}

.dialog-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dialog-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.dialog-btn:focus {
    outline: 2px solid #00ff88;
    outline-offset: 2px;
}

/* Command Palette Styles */
.command-palette {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 2000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 100px;
}

.command-palette.hidden {
    display: none;
}

/* Menu Panel */
#menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1400;
}

#menu-overlay.hidden {
    display: none;
}

#menu-panel {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 360px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    background: rgba(15, 15, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 16px;
    z-index: 1500;
    color: #fff;
}

#menu-panel.hidden {
    display: none;
}

.menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.menu-header h2 {
    margin: 0;
    font-size: 18px;
}

.menu-close {
    padding: 6px 10px;
    font-size: 12px;
}

.menu-section {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-section:last-child {
    border-bottom: none;
}

.menu-section h3 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #a5b4fc;
}

.menu-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    margin-bottom: 12px;
}

.menu-field input {
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.menu-field select {
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.menu-field select option {
    background: #1f2937;
    color: #fff;
}

.menu-actions-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.menu-button {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.menu-button:hover {
    background: rgba(255, 255, 255, 0.16);
}

.menu-button .badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ef4444;
    color: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-button .badge.hidden {
    display: none;
}

.menu-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #93c5fd;
    text-decoration: none;
}

.menu-link:hover {
    color: #bfdbfe;
}

.menu-keys-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
}

.menu-keys-list li {
    margin-bottom: 6px;
}

.menu-slider {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    margin-bottom: 10px;
}

.menu-slider input[type="range"] {
    flex: 1;
}

.worlds-list {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 10px;
    font-size: 12px;
}

.worlds-loading {
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
    padding: 10px;
    text-align: center;
}

.world-item {
    padding: 8px 10px;
    margin: 4px 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.world-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.world-item-name {
    font-weight: 600;
    color: #93c5fd;
}

.world-item-info {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2px;
}

.world-item-actions {
    display: flex;
    gap: 4px;
}

.world-item-btn {
    padding: 4px 8px;
    font-size: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 3px;
    cursor: pointer;
}

.world-item-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.command-palette-content {
    background: white;
    border-radius: 12px;
    width: 600px;
    max-width: 90vw;
    max-height: 70vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideDown 0.2s ease-out;
}

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

#command-input {
    width: 100%;
    padding: 20px;
    border: none;
    font-size: 16px;
    border-bottom: 1px solid #e5e7eb;
    outline: none;
}

.command-results {
    max-height: 500px;
    overflow-y: auto;
}

.command-item {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.1s;
}

.command-item:hover,
.command-item.active {
    background: #f3f4f6;
}

.command-description {
    font-size: 14px;
    color: #374151;
}

.command-key {
    font-size: 12px;
    color: #9ca3af;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f3f4f6;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
}

.command-empty {
    padding: 40px;
    text-align: center;
    color: #9ca3af;
}

/* Activity List Styles */
.activity-list {
    padding: 0;
}

.activity-empty {
    padding: 40px;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
}

.activity-filters {
    margin-top: 15px;
}

.activity-filters select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.2);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.activity-filters select option {
    background: #667eea;
    color: white;
}

/* Shortcuts Help Extended */
.shortcuts-help {
    max-width: 400px;
}

.shortcuts-help h4 {
    color: #fbbf24;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding-bottom: 10px;
}

.shortcut-item {
    padding: 5px 0;
}

.shortcut-item span:first-child {
    color: #d1d5db;
}

/* Template Preview Modal */
.template-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.template-preview-modal.show {
    opacity: 1;
    pointer-events: all;
}

.template-preview-content {
    background: white;
    border-radius: 12px;
    width: 800px;
    max-width: 90vw;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0,0,0,0.5);
}

.template-preview-header {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.template-preview-header h3 {
    margin: 0;
    font-size: 20px;
}

.template-preview-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.template-preview-close:hover {
    background: rgba(255,255,255,0.3);
}

.template-preview-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(80vh - 80px);
}

.template-preview-canvas {
    width: 100%;
    height: 400px;
    background: #1a1a2e;
    border-radius: 8px;
    margin-bottom: 20px;
}

.template-preview-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.template-info-item {
    background: #f9fafb;
    padding: 15px;
    border-radius: 6px;
}

.template-info-label {
    font-size: 11px;
    text-transform: uppercase;
    color: #6b7280;
    font-weight: 600;
    margin-bottom: 5px;
}

.template-info-value {
    font-size: 14px;
    color: #374151;
}

/* Drag and Drop Zone */
.drag-drop-zone {
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    transition: all 0.2s;
}

.drag-drop-zone.drag-over {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.drag-drop-zone-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.drag-drop-zone-text {
    color: #6b7280;
    font-size: 14px;
}

/* Onboarding Tour */
.onboarding-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 3000;
    display: none;
}

.onboarding-overlay.active {
    display: block;
}

.onboarding-tooltip {
    position: absolute;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    max-width: 300px;
    z-index: 3001;
}

.onboarding-tooltip-title {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
}

.onboarding-tooltip-content {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 15px;
}

.onboarding-tooltip-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.onboarding-progress {
    font-size: 12px;
    color: #9ca3af;
}

.onboarding-buttons {
    display: flex;
    gap: 10px;
}

.onboarding-btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.onboarding-btn.primary {
    background: #667eea;
    color: white;
}

.onboarding-btn.primary:hover {
    background: #5a67d8;
}

.onboarding-btn.secondary {
    background: #f3f4f6;
    color: #374151;
}

.onboarding-btn.secondary:hover {
    background: #e5e7eb;
}

/* Loading States */
.loading-spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    z-index: 2500;
    min-width: 200px;
    display: none;
}

.context-menu.show {
    display: block;
}

.context-menu-item {
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    transition: background 0.1s;
}

.context-menu-item:hover {
    background: #f3f4f6;
}

.context-menu-item:first-child {
    border-radius: 8px 8px 0 0;
}

.context-menu-item:last-child {
    border-radius: 0 0 8px 8px;
}

.context-menu-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 5px 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .command-palette-content {
        width: 100%;
        margin: 0 10px;
    }
    
    .template-preview-content {
        width: 100%;
        margin: 0 10px;
    }
    
    .shortcuts-help {
        left: 10px;
        right: 10px;
        max-width: none;
    }
}
