/* GTA SA Handling Editor Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0a14;
    --bg-secondary: #12121f;
    --bg-tertiary: #1a1a2e;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --accent: #ef4444;
    --accent-hover: #f87171;
    --border: #2a2a4a;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

#app {
    display: flex;
    height: 100vh;
}

/* Sidebar */
#sidebar {
    width: 320px;
    min-width: 320px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.site-logo {
    display: inline-block;
    margin-bottom: 8px;
}

.site-logo img {
    height: 24px;
    width: auto;
}

h1 {
    font-size: 18px;
    background: linear-gradient(135deg, var(--accent), #f87171);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

h2 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent);
    font-weight: 600;
}

/* File Section */
.file-section {
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.drop-zone {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 12px;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--accent);
    background: rgba(239, 68, 68, 0.1);
}

.drop-zone svg {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.drop-zone p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 4px 0;
}

.drop-zone .hint {
    font-size: 11px;
    opacity: 0.7;
}

.file-buttons {
    display: flex;
    gap: 8px;
}

.file-buttons .btn {
    flex: 1;
}

/* Tabs Section */
.tabs-section {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: 8px;
}

.tab-btn {
    flex: 1;
    padding: 8px 4px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--accent);
    color: white;
}

.tab-count {
    font-size: 10px;
    opacity: 0.8;
}

/* Search Section */
.search-section {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

/* Vehicle List Section */
.vehicle-list-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 8px;
}

.badge {
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.vehicle-list {
    flex: 1;
    overflow-y: auto;
    margin: 0 16px 16px;
    background: var(--bg-tertiary);
    border-radius: 6px;
}

.vehicle-list-empty {
    padding: 20px 16px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 12px;
}

.vehicle-item {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    transition: background 0.1s;
}

.vehicle-item:last-child {
    border-bottom: none;
}

.vehicle-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.vehicle-item.selected {
    background: var(--accent);
    color: white;
}

.vehicle-item-name {
    font-size: 13px;
    font-weight: 500;
    font-family: 'SF Mono', Monaco, monospace;
}

.vehicle-item-info {
    font-size: 11px;
    color: var(--text-secondary);
}

.vehicle-item.selected .vehicle-item-info {
    color: rgba(255, 255, 255, 0.7);
}

/* Credits */
.credits {
    padding: 12px 16px;
    text-align: center;
    font-size: 11px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
}

.credits a {
    color: var(--accent);
    text-decoration: none;
}

.credits a:hover {
    text-decoration: underline;
}

/* Main Area */
#main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-primary);
}

/* Empty State */
.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    padding: 40px;
}

.empty-state svg {
    opacity: 0.3;
    margin-bottom: 20px;
}

.empty-state h2 {
    font-size: 18px;
    color: var(--text-primary);
    text-transform: none;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 13px;
    text-align: center;
}

/* Editor Panel */
.editor-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.editor-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}

.editor-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.editor-title h2 {
    font-size: 20px;
    color: var(--text-primary);
    text-transform: none;
    font-family: 'SF Mono', Monaco, monospace;
}

.vehicle-type-badge {
    background: var(--accent);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
}

.editor-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

/* Parameter Groups */
.parameter-group {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 12px;
}

.group-header {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.group-header:hover {
    background: rgba(255, 255, 255, 0.02);
}

.group-toggle {
    width: 16px;
    font-family: monospace;
    color: var(--accent);
}

.group-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.group-body {
    padding: 0 16px 16px;
    border-top: 1px solid var(--border);
}

/* Field Row */
.field-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.field-row:last-child {
    border-bottom: none;
}

.field-label {
    width: 180px;
    min-width: 180px;
    font-size: 12px;
    color: var(--text-secondary);
}

.field-input-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Input Field */
.input-field {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    transition: border-color 0.2s;
}

.input-field:focus {
    outline: none;
    border-color: var(--accent);
}

.input-field::placeholder {
    color: var(--text-secondary);
}

.number-input {
    width: 100px;
    min-width: 100px;
    text-align: right;
    font-family: 'SF Mono', Monaco, monospace;
}

/* Slider */
.slider {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    background: var(--bg-tertiary);
    border-radius: 3px;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--accent);
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

/* Select */
select.input-field {
    cursor: pointer;
}

/* Flag Editor */
.flag-section {
    padding-top: 12px;
}

.flag-section-header {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.flag-editor {
    background: var(--bg-tertiary);
    border-radius: 6px;
    padding: 12px;
}

.flag-hex-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.flag-hex-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.flag-hex-input {
    width: 120px;
    font-family: 'SF Mono', Monaco, monospace;
    text-transform: uppercase;
}

.flag-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.flag-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.flag-item input[type="checkbox"] {
    accent-color: var(--accent);
    cursor: pointer;
    width: 14px;
    height: 14px;
}

.flag-label {
    font-size: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.flag-item:hover .flag-label {
    color: var(--text-primary);
}

/* Output Section */
.output-section {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
}

.output-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.output-header h3 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.output-preview {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 11px;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 80px;
    overflow-y: auto;
}

/* Buttons */
.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--border);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.btn.copied {
    background: var(--success) !important;
    color: white !important;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Notification */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-primary);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.notification.success {
    border-color: var(--success);
}

.notification.error {
    border-color: var(--danger);
}

.notification.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes slideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        transform: translateY(20px);
        opacity: 0;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Responsive */
@media (max-width: 1024px) {
    .flag-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    #app {
        flex-direction: column;
    }

    #sidebar {
        width: 100%;
        min-width: 100%;
        max-height: 45vh;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    #main {
        min-height: 55vh;
    }

    .vehicle-list {
        max-height: 150px;
    }

    .editor-body {
        padding: 12px 16px;
    }

    .field-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .field-label {
        width: 100%;
    }

    .field-input-container {
        width: 100%;
    }

    .flag-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
