/* Radar Generator 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: 360px;
    min-width: 360px;
    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: #10b981;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    margin-top: 20px;
}

h2:first-of-type {
    margin-top: 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:hover,
.drop-zone.drag-over {
    border-color: #10b981;
    background: rgba(16, 185, 129, 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: #10b981;
}

.drop-zone p {
    color: #888;
    font-size: 14px;
    margin: 5px 0;
}

.drop-zone .hint {
    font-size: 12px;
    color: #666;
}

/* Status Panel */
.status-panel {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: #252538;
    border-radius: 8px;
    margin-bottom: 20px;
}

.status-icon {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #888;
}

.status-icon.loading {
    background: #f59e0b;
    animation: pulse 1s ease-in-out infinite;
}

.status-icon.ready {
    background: #10b981;
}

.status-icon.error {
    background: #ef4444;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

#load-status-text {
    font-size: 14px;
    color: #ccc;
}

/* Config Panel */
.config-panel {
    flex: 1;
}

.config-group {
    background: #252538;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.config-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.config-row:last-child {
    margin-bottom: 0;
}

.config-row label {
    font-size: 14px;
    color: #aaa;
    min-width: 100px;
}

.config-row input[type="number"],
.config-row select {
    flex: 1;
    padding: 8px 12px;
    background: #1a1a2e;
    border: 1px solid #3d3d5c;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
}

.config-row input[type="number"]:focus,
.config-row select:focus {
    outline: none;
    border-color: #10b981;
}

.config-row input[type="color"] {
    width: 50px;
    height: 32px;
    padding: 2px;
    background: #1a1a2e;
    border: 1px solid #3d3d5c;
    border-radius: 6px;
    cursor: pointer;
}

.config-row .unit {
    font-size: 12px;
    color: #666;
}

/* Radio & Checkbox Labels */
.radio-label,
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #ccc;
    cursor: pointer;
    padding: 8px 0;
}

.radio-label input,
.checkbox-label input {
    accent-color: #10b981;
    width: 16px;
    height: 16px;
}

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3d3d5c;
    color: #888;
    font-size: 10px;
    font-weight: bold;
    cursor: help;
    margin-left: auto;
}

/* Custom Bounds */
.custom-bounds {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #3d3d5c;
}

.bounds-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.bounds-row:last-child {
    margin-bottom: 0;
}

.bounds-row label {
    font-size: 13px;
    color: #888;
    width: 20px;
}

.bounds-row input {
    width: 80px;
    padding: 6px 10px;
    background: #1a1a2e;
    border: 1px solid #3d3d5c;
    border-radius: 4px;
    color: #fff;
    font-size: 13px;
}

.bounds-row span {
    font-size: 12px;
    color: #666;
}

/* Buttons */
.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
}

.btn-primary {
    background: #10b981;
    color: #fff;
}

.btn-primary:hover {
    background: #059669;
}

.btn-primary:disabled {
    background: #4a4a6a;
    cursor: not-allowed;
}

.btn-secondary {
    background: #3d3d5c;
    color: #fff;
}

.btn-secondary:hover:not(:disabled) {
    background: #4a4a6a;
}

.btn-secondary:disabled {
    background: #2a2a3a;
    color: #666;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-danger {
    background: #ef4444;
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
}

/* Progress Panel */
.progress-panel {
    margin-top: 20px;
}

.progress-bar-container {
    height: 8px;
    background: #252538;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 24px;
    font-weight: 600;
    color: #fff;
    text-align: center;
    margin-bottom: 5px;
}

.progress-details {
    font-size: 14px;
    color: #888;
    text-align: center;
}

.time-estimate {
    font-size: 12px;
    color: #666;
    text-align: center;
    margin-top: 5px;
}

/* Export Panel */
.export-panel {
    margin-top: 20px;
}

.export-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.export-buttons .btn {
    flex: 1 1 calc(50% - 5px);
    min-width: 140px;
}

.export-info {
    font-size: 13px;
    color: #888;
    margin-top: 10px;
    text-align: center;
}

/* Download Progress */
.download-progress {
    margin-top: 15px;
    padding: 12px;
    background: #252538;
    border-radius: 8px;
}

.download-progress-text {
    font-size: 13px;
    color: #ccc;
    margin-bottom: 8px;
    text-align: center;
}

.download-progress-bar-container {
    height: 6px;
    background: #1a1a2e;
    border-radius: 3px;
    overflow: hidden;
}

.download-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #d97706);
    width: 0%;
    transition: width 0.2s ease;
}

.download-progress.complete .download-progress-bar {
    background: linear-gradient(90deg, #10b981, #059669);
}

/* Credits */
.credits {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid #2d2d44;
    font-size: 12px;
    color: #666;
    text-align: center;
}

.credits a {
    color: #10b981;
    text-decoration: none;
}

.credits a:hover {
    text-decoration: underline;
}

.credits p {
    margin: 3px 0;
}

/* Viewport */
#viewport {
    flex: 1;
    background: #0a0a14;
    position: relative;
    overflow: hidden;
}

#preview-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Tile Grid Preview */
.tile-grid {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: grid;
    gap: 2px;
    background: #1a1a2e;
    padding: 10px;
    border-radius: 8px;
    max-width: 90%;
    max-height: 90%;
    overflow: auto;
}

.tile-grid img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 2px;
    background: #252538;
}

.tile-grid .tile-placeholder {
    width: 64px;
    height: 64px;
    background: #252538;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #666;
}

/* Viewport Info */
.viewport-info {
    position: absolute;
    bottom: 20px;
    left: 20px;
    display: flex;
    gap: 20px;
    font-size: 12px;
    color: #666;
    background: rgba(26, 26, 46, 0.9);
    padding: 8px 12px;
    border-radius: 6px;
}

/* 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: 800px) {
    #app {
        flex-direction: column;
    }

    #sidebar {
        width: 100%;
        min-width: 100%;
        max-height: 50vh;
        border-right: none;
        border-bottom: 1px solid #2d2d44;
    }

    #viewport {
        min-height: 50vh;
    }
}
