* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    height: 100vh;
    background-color: #1e1e1e;
    color: #ffffff;
    overflow: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

#topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background-color: #252526;
    border-bottom: 1px solid #37373d;
}

.left-controls {
    display: flex;
    gap: 8px;
}

button {
    background-color: #383838;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #454545;
}

button.active {
    background-color: #007acc;
}

.mode-tabs {
    display: flex;
    gap: 4px;
}

.mode-btn {
    padding: 8px 16px;
}

#face-info {
    padding: 8px 12px;
    background-color: #383838;
    border-radius: 4px;
    font-size: 0.9rem;
}

#viewport-container {
    position: relative;
    flex-grow: 1;
    background-color: #252526;
}

#viewport {
    width: 100%;
    height: 100%;
}

#loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007acc;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 2s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#drop-hint {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(30, 144, 255, 0.1);
    border: 3px dashed #1e90ff;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10;
    pointer-events: none;
}

#drop-hint p {
    font-size: 1.5rem;
    color: white;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 16px 24px;
    border-radius: 8px;
}

.drag-highlight {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.3; }
}

aside {
    position: fixed;
    height: calc(100vh - 60px);
    top: 60px;
    width: 250px;
    background-color: #252526;
    padding: 16px;
    border-right: 1px solid #37373d;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

#paint-panel {
    left: 0;
    transform: translateX(-100%);
}

#material-panel {
    right: 0;
    transform: translateX(100%);
}

aside.active {
    transform: translateX(0);
}

.tool-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.tool-btn {
    width: 60px;
    height: 60px;
    font-size: 24px;
    background-color: #383838;
    border-radius: 8px;
}

.tool-btn.active {
    background-color: #007acc;
}

.tool-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.option {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

input[type="range"] {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    background-color: #383838;
    border-radius: 4px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background-color: #007acc;
    border-radius: 50%;
    cursor: pointer;
}

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

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

.slider-group label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #383838;
    min-width: 120px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
    z-index: 1;
    border-radius: 4px;
    overflow: hidden;
}

.dropdown-content button {
    width: 100%;
    text-align: left;
    border-radius: 0;
}

.dropdown:hover .dropdown-content {
    display: block;
}