:root {
    --ui-bg: rgba(20, 20, 20, 0.75);
    --ui-border: rgba(255, 255, 255, 0.1);
    --text-main: #ffffff;
    --text-muted: #888888;
    --accent: #6366f1;
}

body {
    margin: 0;
    overflow: hidden;
    font-family: 'Inter', system-ui, sans-serif;
    background-color: #111;
    color: var(--text-main);
}

/* 3D Canvas Container */
#canvas-container {
    width: 100vw;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    background: radial-gradient(circle at center, #2a2a2a 0%, #000000 100%);
}

/* UI Sidebar */
#ui-panel {
    position: absolute;
    right: 20px;
    top: 20px;
    bottom: 20px;
    width: 320px;
    background: var(--ui-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--ui-border);
    border-radius: 16px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    transition: transform 0.3s ease;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.brand {
    font-weight: 800;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    color: var(--accent);
    font-size: 1.5rem;
}

.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
}

    .btn-primary:hover {
        background: #4f46e5;
    }

.controls {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

section h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.control-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

    .control-row label {
        font-size: 0.9rem;
    }

input[type="color"] {
    border: none;
    width: 30px;
    height: 30px;
    cursor: pointer;
    background: none;
}

input[type="range"] {
    width: 100%;
    cursor: pointer;
}

.control-group {
    margin-bottom: 1rem;
}

    .control-group label {
        display: block;
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
        color: var(--text-muted);
    }

/* Upload Zone */
.upload-zone {
    border: 2px dashed var(--ui-border);
    border-radius: 8px;
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

    .upload-zone:hover {
        border-color: var(--accent);
        background: rgba(99, 102, 241, 0.1);
    }

    .upload-zone input {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        opacity: 0;
        cursor: pointer;
    }

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

    .upload-content .icon {
        font-size: 1.5rem;
    }

    .upload-content .text {
        font-size: 0.85rem;
        color: var(--text-muted);
    }

hr {
    border: 0;
    height: 1px;
    background: var(--ui-border);
}

footer {
    margin-top: auto;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.7rem;
    padding-top: 1rem;
}

/* Loader */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Back link */
.back-link {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 100;
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.back-link:hover {
    opacity: 1;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.product-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    padding: 0.75rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.2s;
    color: var(--text-main);
}

.product-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
}

.product-btn.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--accent);
}

.product-icon {
    font-size: 1.5rem;
}

.product-name {
    font-size: 0.8rem;
    font-weight: 500;
}

.product-price {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 600;
}

/* Text Controls */
#text-controls select option {
    color: #000;
    background: #fff;
}

#text-controls input[type="text"]::placeholder {
    color: rgba(255,255,255,0.3);
}

#text-controls input[type="text"]:focus {
    border-color: var(--accent);
    outline: none;
}

#text-controls select:focus {
    border-color: var(--accent);
    outline: none;
}
