/* MTA Collision Manager 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: #a855f7;
    --accent-hover: #c084fc;
    --border: #2a2a4a;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --collision: rgba(168, 85, 247, 0.4);
}

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: 300px;
    min-width: 300px;
    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), #c084fc);
    -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;
}

/* Config Section */
.config-section {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.config-section > label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent);
    margin-bottom: 8px;
    font-weight: 600;
}

.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);
}

/* Radio Group */
.radio-group {
    display: flex;
    gap: 16px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
}

.radio-label input {
    accent-color: var(--accent);
    cursor: pointer;
}

/* Section Header */
.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;
}

/* Area List */
.area-list {
    flex: 1;
    min-height: 100px;
    max-height: 200px;
    overflow-y: auto;
    margin: 0 16px 16px;
    background: var(--bg-tertiary);
    border-radius: 6px;
}

.area-list-empty {
    padding: 20px 16px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.5;
}

.area-list-item {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    transition: background 0.1s;
}

.area-list-item:last-child {
    border-bottom: none;
}

.area-list-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.area-list-item.selected {
    background: var(--accent);
    color: white;
}

.area-list-item .area-icon {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    flex-shrink: 0;
    background: var(--collision);
    border: 2px dashed var(--accent);
}

.area-list-item .area-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: monospace;
}

.area-list-item .area-enabled {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    flex-shrink: 0;
}

.area-list-item .area-enabled.disabled {
    background: var(--text-secondary);
}

/* Properties Panel */
.properties-panel {
    border-top: 1px solid var(--border);
    padding-bottom: 8px;
}

.properties-body {
    padding: 0 16px;
}

.prop-row {
    margin-bottom: 12px;
}

.prop-row > label {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.prop-coords {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.prop-hint {
    display: block;
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 4px;
    opacity: 0.7;
}

/* Checkbox Row */
.checkbox-row {
    margin-top: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
}

.checkbox-label input {
    accent-color: var(--accent);
    cursor: pointer;
    width: 16px;
    height: 16px;
}

/* 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-icon {
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-icon.delete:hover {
    background: var(--danger);
    color: white;
}

.btn-icon.copied,
.btn.copied {
    background: var(--success) !important;
    color: white !important;
}

.header-buttons {
    display: flex;
    gap: 4px;
}

.btn-small {
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.btn-small:hover {
    background: var(--accent);
    color: white;
}

.btn-small.copied {
    background: var(--success) !important;
    color: white !important;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    margin-top: auto;
}

/* 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;
    position: relative;
    background: var(--bg-primary);
}

/* Toolbar */
#toolbar {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(18, 18, 31, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 100;
}

.toolbar-group {
    display: flex;
    gap: 4px;
}

.tool-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.tool-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.tool-btn.active {
    background: var(--accent);
    color: white;
}

.tool-btn svg {
    width: 20px;
    height: 20px;
}

.toolbar-divider {
    height: 1px;
    background: var(--border);
}

/* Canvas Container */
#canvas-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

#canvas {
    display: block;
    cursor: crosshair;
    position: absolute;
    top: 0;
    left: 0;
}

/* Info Bar */
#info-bar {
    position: absolute;
    bottom: 16px;
    left: 16px;
    background: rgba(18, 18, 31, 0.9);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    gap: 16px;
    z-index: 100;
}

#info-bar span {
    font-family: 'SF Mono', Monaco, monospace;
}

/* 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: var(--bg-secondary);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    color: var(--text-primary);
    text-transform: none;
    font-size: 16px;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--accent);
    background: rgba(168, 85, 247, 0.1);
}

.drop-zone svg {
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.drop-zone p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 4px 0;
}

.drop-zone .hint {
    font-size: 11px;
    opacity: 0.7;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* 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: 768px) {
    #app {
        flex-direction: column;
    }

    #sidebar {
        width: 100%;
        min-width: 100%;
        max-height: 50vh;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    #main {
        min-height: 50vh;
    }

    .area-list {
        max-height: 120px;
    }
}
