/* MTA Vehicle Manager Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #0f0f1a;
    color: #e0e0e0;
    overflow: hidden;
}

#app {
    display: flex;
    height: 100vh;
}

/* Sidebar */
#sidebar {
    width: 400px;
    min-width: 400px;
    background: #1a1a2e;
    padding: 20px;
    overflow-y: auto;
    border-right: 1px solid #2d2d44;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    margin-bottom: 20px;
}

.site-logo {
    display: inline-block;
    margin-bottom: 10px;
}

.site-logo img {
    height: 24px;
    width: auto;
}

h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #fff;
}

.subtitle {
    color: #888;
    font-size: 14px;
}

h2 {
    font-size: 14px;
    font-weight: 600;
    color: #f97316;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed #3d3d5c;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 20px;
}

.drop-zone.small {
    padding: 20px 15px;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: #f97316;
    background: rgba(249, 115, 22, 0.1);
}

.drop-icon {
    color: #4a4a6a;
    margin-bottom: 10px;
    transition: color 0.2s;
}

.drop-zone:hover .drop-icon,
.drop-zone.drag-over .drop-icon {
    color: #f97316;
}

.drop-zone p {
    color: #888;
    font-size: 14px;
    margin: 5px 0;
}

.drop-zone .hint {
    font-size: 12px;
    color: #666;
}

/* Info Box */
.info-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.2);
    border-radius: 8px;
    margin-bottom: 20px;
}

.info-icon {
    color: #f97316;
    flex-shrink: 0;
    margin-top: 2px;
}

.info-box p {
    font-size: 12px;
    color: #aaa;
    line-height: 1.5;
    margin: 0;
}

.info-box code {
    background: rgba(249, 115, 22, 0.2);
    padding: 1px 4px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 11px;
    color: #fdba74;
}

/* Config Section */
.config-section {
    margin-bottom: 20px;
}

.config-section label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #f97316;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    text-transform: none;
    letter-spacing: normal;
    font-weight: 500;
    color: #e0e0e0;
    margin-bottom: 0;
}

.checkbox-label input {
    width: 16px;
    height: 16px;
    accent-color: #f97316;
    cursor: pointer;
}

.config-hint {
    font-size: 11px;
    color: #666;
    margin-top: 6px;
    line-height: 1.4;
}

.input-field {
    width: 100%;
    padding: 10px 14px;
    background: #252538;
    border: 1px solid #3d3d5c;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    transition: border-color 0.2s;
}

.input-field:focus {
    outline: none;
    border-color: #f97316;
}

.input-field::placeholder {
    color: #666;
}

/* Vehicle List Container */
.vehicle-list-container {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.badge {
    background: #f97316;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.vehicle-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Vehicle Item */
.vehicle-item {
    background: #252538;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.2s;
}

.vehicle-item:hover {
    background: #2d2d44;
}

.vehicle-item.selected {
    background: #2d2d44;
    box-shadow: inset 0 0 0 2px #f97316;
}

.vehicle-item.disabled {
    opacity: 0.5;
}

.vehicle-checkbox {
    flex-shrink: 0;
}

.vehicle-checkbox input {
    width: 18px;
    height: 18px;
    accent-color: #f97316;
    cursor: pointer;
}

.vehicle-info {
    flex: 1;
    min-width: 0;
}

.vehicle-name {
    font-weight: 600;
    color: #fff;
    font-size: 14px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vehicle-files {
    font-size: 11px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vehicle-comment {
    width: 100%;
    padding: 4px 8px;
    background: #1a1a2e;
    border: 1px solid transparent;
    border-radius: 4px;
    color: #aaa;
    font-size: 12px;
    margin-top: 6px;
    transition: border-color 0.2s;
}

.vehicle-comment:focus {
    outline: none;
    border-color: #f97316;
}

.vehicle-comment::placeholder {
    color: #555;
}

.vehicle-id-btn {
    background: #3d3d5c;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.vehicle-id-btn:hover {
    background: #4a4a6a;
}

.vehicle-id-btn.assigned {
    background: #f97316;
}

.vehicle-id-btn.error {
    background: #ef4444;
}

.vehicle-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.vehicle-actions button {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: #3d3d5c;
    color: #aaa;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.vehicle-actions button:hover {
    background: #4a4a6a;
    color: #fff;
}

.vehicle-actions button.preview-btn:hover {
    background: #f97316;
}

.vehicle-actions button.remove-btn:hover {
    background: #ef4444;
}

/* Warning Panel */
.warning-panel {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 8px;
    margin-bottom: 20px;
}

.warning-icon {
    width: 24px;
    height: 24px;
    background: #f59e0b;
    color: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
}

.warning-content strong {
    display: block;
    color: #f59e0b;
    font-size: 13px;
    margin-bottom: 4px;
}

.warning-content p {
    font-size: 12px;
    color: #aaa;
    margin: 0;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 20px;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: #f97316;
    color: #fff;
}

.btn-primary:hover {
    background: #ea580c;
}

.btn-primary:disabled {
    background: #4a4a6a;
    cursor: not-allowed;
}

.btn-secondary {
    background: #3d3d5c;
    color: #fff;
}

.btn-secondary:hover {
    background: #4a4a6a;
}

.btn-small {
    padding: 6px 10px;
    font-size: 12px;
}

/* Credits */
.credits {
    padding-top: 20px;
    border-top: 1px solid #2d2d44;
    font-size: 12px;
    color: #666;
    text-align: center;
}

.credits a {
    color: #f97316;
    text-decoration: none;
}

.credits a:hover {
    text-decoration: underline;
}

/* Main Content */
#main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #0a0a14;
}

/* Preview Panel */
#preview-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.preview-header {
    padding: 15px 20px;
    background: #1a1a2e;
    border-bottom: 1px solid #2d2d44;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.preview-vehicle-name {
    font-size: 14px;
    color: #888;
}

#preview-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

#preview-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.preview-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #4a4a6a;
}

.preview-placeholder p {
    margin-top: 15px;
    font-size: 14px;
}

.preview-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 20, 0.9);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #3d3d5c;
    border-top-color: #f97316;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.preview-loading p {
    margin-top: 15px;
    color: #888;
    font-size: 14px;
}

.preview-controls {
    padding: 10px 20px;
    background: #1a1a2e;
    border-top: 1px solid #2d2d44;
    display: flex;
    align-items: center;
    gap: 15px;
}

.checkbox-small {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #888;
    cursor: pointer;
}

.checkbox-small input {
    accent-color: #f97316;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
}

.modal-content {
    position: relative;
    background: #1a1a2e;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.vehicle-picker-content {
    max-width: 800px;
    height: 80vh;
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #2d2d44;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    color: #fff;
    text-transform: none;
    font-size: 18px;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #3d3d5c;
    color: #fff;
}

.modal-body {
    padding: 20px;
}

/* Vehicle Picker */
.vehicle-picker-search {
    padding: 15px 20px;
    border-bottom: 1px solid #2d2d44;
}

.vehicle-picker-filters {
    display: flex;
    gap: 8px;
    padding: 10px 20px;
    border-bottom: 1px solid #2d2d44;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 6px 12px;
    background: #252538;
    border: none;
    border-radius: 15px;
    color: #888;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: #3d3d5c;
    color: #fff;
}

.filter-btn.active {
    background: #f97316;
    color: #fff;
}

.vehicle-picker-tabs {
    display: flex;
    padding: 0 20px;
    border-bottom: 1px solid #2d2d44;
}

.tab-btn {
    padding: 12px 20px;
    background: none;
    border: none;
    color: #888;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: #fff;
}

.tab-btn.active {
    color: #f97316;
    border-bottom-color: #f97316;
}

.vehicle-picker-tab {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

/* Vehicle Grid */
.vehicle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.vehicle-thumb {
    background: #252538;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.vehicle-thumb:hover {
    background: #3d3d5c;
}

.vehicle-thumb.selected {
    background: #f97316;
}

.vehicle-thumb.used {
    opacity: 0.3;
    pointer-events: none;
}

.vehicle-thumb img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 4px;
    background: #1a1a2e;
    margin-bottom: 6px;
}

.vehicle-thumb .vehicle-id {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}

.vehicle-thumb .vehicle-name {
    display: block;
    font-size: 10px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Vehicle List */
.vehicle-picker-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.vehicle-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #252538;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.vehicle-list-item:hover {
    background: #3d3d5c;
}

.vehicle-list-item.selected {
    background: #f97316;
}

.vehicle-list-item.used {
    opacity: 0.3;
    pointer-events: none;
}

.vehicle-list-item img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 4px;
    background: #1a1a2e;
}

.vehicle-list-item .vehicle-id {
    font-weight: 600;
    color: #fff;
    width: 40px;
}

.vehicle-list-item .vehicle-name {
    flex: 1;
    color: #aaa;
    font-size: 13px;
}

.vehicle-list-item .vehicle-type {
    color: #666;
    font-size: 11px;
    text-transform: capitalize;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a2e;
}

::-webkit-scrollbar-thumb {
    background: #3d3d5c;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4a4a6a;
}

/* Responsive */
@media (max-width: 900px) {
    #app {
        flex-direction: column;
    }

    #sidebar {
        width: 100%;
        min-width: 100%;
        max-height: 50vh;
        border-right: none;
        border-bottom: 1px solid #2d2d44;
    }

    #main-content {
        min-height: 50vh;
    }

    .vehicle-picker-content {
        width: 95%;
        height: 90vh;
    }

    .vehicle-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
}
