/**
 * Mob Variables Editor Styles
 * UI component for managing mob-level variables
 */

/* Main Container */
.mob-variables-editor {
    background: var(--bg-secondary, #252541);
    border-radius: 12px;
    border: 1px solid var(--border-color, #3a3a5c);
    overflow: hidden;
}

/* Header */
.variables-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    background: var(--bg-tertiary, #2a2a4a);
    border-bottom: 1px solid var(--border-color, #3a3a5c);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.header-left i {
    color: #8b5cf6;
    font-size: 1rem;
}

.header-left h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
}

.variable-count {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.btn-add-variable {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 100%);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-add-variable:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

/* Content Area */
.variables-content {
    padding: 1rem;
}

.variables-content.empty {
    padding: 2rem 1rem;
}

/* Empty State */
.variables-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem;
}

.variables-empty i {
    font-size: 2.5rem;
    color: var(--text-tertiary, #6a6a8a);
    margin-bottom: 0.75rem;
}

.variables-empty p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-secondary, #a0a0c0);
}

.variables-empty small {
    color: var(--text-tertiary, #6a6a8a);
    margin-top: 0.25rem;
}

/* Variables List */
.variables-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Variable Item */
.variable-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--bg-primary, #1a1a2e);
    border: 1px solid var(--border-color, #3a3a5c);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.variable-item:hover {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.05);
}

.variable-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.variable-type-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary, #252541);
    border-radius: 6px;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.variable-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.variable-name {
    font-weight: 600;
    color: var(--text-primary, #ffffff);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
}

.variable-value {
    font-size: 0.8rem;
    color: var(--text-secondary, #a0a0c0);
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.variable-actions {
    display: flex;
    gap: 0.375rem;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.variable-item:hover .variable-actions {
    opacity: 1;
}

.variable-actions button {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary, #252541);
    border: 1px solid var(--border-color, #3a3a5c);
    border-radius: 6px;
    color: var(--text-secondary, #a0a0c0);
    cursor: pointer;
    transition: all 0.2s ease;
}

.variable-actions button:hover {
    border-color: #8b5cf6;
    color: #8b5cf6;
}

.btn-delete-variable:hover {
    border-color: #ef4444 !important;
    color: #ef4444 !important;
}

/* Help Section */
.variables-help {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-color, #3a3a5c);
}

.variables-help details {
    margin: 0;
}

.variables-help summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary, #a0a0c0);
    cursor: pointer;
    list-style: none;
}

.variables-help summary::-webkit-details-marker {
    display: none;
}

.variables-help summary i {
    color: #8b5cf6;
}

.variables-help summary::after {
    content: '▸';
    margin-left: auto;
    transition: transform 0.2s ease;
}

.variables-help details[open] summary::after {
    transform: rotate(90deg);
}

.help-content {
    padding: 0.75rem 0;
    font-size: 0.85rem;
    color: var(--text-secondary, #a0a0c0);
}

.help-content p {
    margin: 0 0 0.5rem 0;
}

.help-content ul {
    margin: 0;
    padding-left: 1.25rem;
}

.help-content li {
    margin-bottom: 0.25rem;
}

.help-content code {
    background: var(--bg-primary, #1a1a2e);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #8b5cf6;
}

/* Dialog Styles */
.variable-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.variable-dialog {
    background: var(--bg-primary, #1a1a2e);
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.2s ease;
}

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

.variable-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.variable-dialog-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dialog-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.variable-dialog-body {
    padding: 1.25rem;
}

.variable-dialog-body .form-group {
    margin-bottom: 1rem;
}

.variable-dialog-body .form-group:last-child {
    margin-bottom: 0;
}

.variable-dialog-body label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary, #ffffff);
    margin-bottom: 0.375rem;
}

.variable-dialog-body input,
.variable-dialog-body select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: var(--bg-secondary, #252541);
    border: 2px solid var(--border-color, #3a3a5c);
    border-radius: 6px;
    color: var(--text-primary, #ffffff);
    font-size: 0.9rem;
}

.variable-dialog-body input:focus,
.variable-dialog-body select:focus {
    outline: none;
    border-color: #8b5cf6;
}

.variable-dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--bg-secondary, #252541);
    border-radius: 0 0 12px 12px;
}

.variable-dialog-footer button {
    padding: 0.625rem 1.25rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.variable-dialog-footer .btn-cancel {
    background: var(--bg-primary, #1a1a2e);
    border: 1px solid var(--border-color, #3a3a5c);
    color: var(--text-primary, #ffffff);
}

.variable-dialog-footer .btn-cancel:hover {
    border-color: var(--text-secondary, #a0a0c0);
}

.variable-dialog-footer .btn-add,
.variable-dialog-footer .btn-save {
    background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 100%);
    border: none;
    color: white;
}

.variable-dialog-footer .btn-add:hover,
.variable-dialog-footer .btn-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

/* Responsive */
@media (max-width: 600px) {
    .variables-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
    
    .header-left {
        justify-content: center;
    }
    
    .btn-add-variable {
        justify-content: center;
    }
    
    .variable-item {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
    
    .variable-actions {
        justify-content: flex-end;
        opacity: 1;
    }
}
