* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #0f172a;
    min-height: 100vh;
    padding: 0;
    color: #f1f5f9;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.main-content {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 20px;
    align-items: start;
}

.controls-panel {
    background: #1e293b;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
    position: relative;
}

.controls-grid::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #334155;
    transform: translateX(-50%);
}

.controls-column {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.control-section-full {
    grid-column: 1 / -1;
    border-top: 1px solid #334155;
    padding-top: 16px;
    margin-bottom: 0;
}

.control-section {
    margin-bottom: 0;
    padding-bottom: 16px;
    border-bottom: 1px solid #334155;
}

.controls-column .control-section {
    margin-bottom: 16px;
}

.controls-column .control-section:last-child {
    margin-bottom: 0;
}

.control-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.control-section h3 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: #f1f5f9;
    font-weight: 600;
}

.control-group {
    margin-bottom: 12px;
}

.control-group label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.85rem;
    color: #cbd5e1;
    font-weight: 500;
}

.control-group input[type="range"] {
    width: calc(100% - 50px);
    margin-right: 10px;
    vertical-align: middle;
    height: 8px;
    background: #475569;
    border-radius: 8px;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #6366f1;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.control-group input[type="range"]::-webkit-slider-thumb:hover {
    background: #818cf8;
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #6366f1;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}

.control-group input[type="range"]::-moz-range-thumb:hover {
    background: #818cf8;
}

.control-group span {
    display: inline-block;
    width: 35px;
    text-align: center;
    font-weight: 600;
    color: #ffffff;
}

.control-group select,
.control-group input[type="color"] {
    width: 100%;
    padding: 6px 10px;
    border: 2px solid #334155;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.control-group select:focus,
.control-group input[type="color"]:focus {
    outline: none;
    border-color: #818cf8;
}

.control-group input[type="color"] {
    height: 36px;
    cursor: pointer;
}

.custom-colors-section {
    margin-top: 12px;
    margin-bottom: 12px;
}

.custom-colors-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.custom-color {
    width: 100%;
    height: 40px;
    border: 2px solid #334155;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.custom-color:hover {
    border-color: #818cf8;
}

.custom-color:focus {
    outline: none;
    border-color: #818cf8;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #818cf8;
}

.checkbox-group label {
    margin: 0;
    cursor: pointer;
}

.btn-primary,
.btn-secondary {
    width: 100%;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 8px;
}

.btn-primary {
    background: #6366f1;
    color: white;
}

.btn-primary:hover {
    background: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: #10b981;
    color: white;
}

.btn-secondary:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
}

.btn-secondary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.preview-panel {
    background: #1e293b;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 600px;
}

.canvas-container {
    max-width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#uvCanvas {
    max-width: 100%;
    height: auto;
    border: 2px solid #334155;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.controls-panel::-webkit-scrollbar {
    width: 8px;
}

.controls-panel::-webkit-scrollbar-track {
    background: #0f172a;
    border-radius: 4px;
}

.controls-panel::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

.controls-panel::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .controls-panel {
        max-height: none;
    }

    .controls-grid {
        grid-template-columns: 1fr;
    }
}
