/* Gouraud Shading Simulator Styles */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #e0e0e0;
    min-height: 100vh;
    overflow-x: hidden;
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    text-align: center;
    padding: 1rem;
    background: rgba(42, 42, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(45deg, #00bfff, #ff6b35);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header p {
    color: #b0b0b0;
    font-size: 1rem;
}

.main-container {
    flex: 1;
    display: grid;
    grid-template-columns: 300px 1fr 300px;
    gap: 1rem;
    padding: 1rem;
    max-height: calc(100vh - 120px);
}

.controls-left,
.controls-right {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 100%;
    overflow-y: auto;
}

.panel {
    background: rgba(58, 58, 58, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.panel:hover {
    border-color: rgba(0, 191, 255, 0.3);
    box-shadow: 0 6px 20px rgba(0, 191, 255, 0.1);
}

.panel h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #00bfff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.collapsible h3 {
    cursor: pointer;
    justify-content: space-between;
    user-select: none;
}

.collapsible.collapsed .panel-content {
    display: none;
}

.toggle {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.viewport {
    position: relative;
    background: rgba(26, 26, 26, 0.8);
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

#scene-container {
    width: 100%;
    height: 100%;
    min-height: 500px;
}

.viewport-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.stats {
    background: rgba(0, 0, 0, 0.7);
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-family: 'Courier New', monospace;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.stats div {
    margin-bottom: 0.25rem;
}

.stats span {
    color: #00bfff;
    font-weight: bold;
}

.mode-indicator {
    background: rgba(255, 107, 53, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.shading-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tab-btn {
    flex: 1;
    padding: 0.5rem;
    background: rgba(68, 68, 68, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #e0e0e0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
    font-weight: 500;
}

.tab-btn:hover {
    background: rgba(0, 191, 255, 0.2);
    border-color: #00bfff;
}

.tab-btn.active {
    background: linear-gradient(45deg, #00bfff, #0080cc);
    border-color: #00bfff;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 191, 255, 0.3);
}

label {
    display: block;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: #c0c0c0;
}

input[type="range"] {
    width: 100%;
    margin-top: 0.25rem;
    accent-color: #00bfff;
}

input[type="color"] {
    width: 60px;
    height: 30px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 0.5rem;
}

select {
    width: 100%;
    padding: 0.5rem;
    background: rgba(68, 68, 68, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

select:focus {
    outline: none;
    border-color: #00bfff;
    box-shadow: 0 0 0 2px rgba(0, 191, 255, 0.2);
}

.material-presets {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.material-presets button,
button[data-preset] {
    padding: 0.4rem 0.8rem;
    background: rgba(255, 107, 53, 0.8);
    border: 1px solid rgba(255, 107, 53, 0.4);
    border-radius: 20px;
    color: white;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.material-presets button:hover,
button[data-preset]:hover {
    background: rgba(255, 107, 53, 1);
    border-color: #ff6b35;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 107, 53, 0.3);
}

input[type="checkbox"] {
    margin-right: 0.5rem;
    accent-color: #00bfff;
}

.panel-content {
    font-size: 0.8rem;
    line-height: 1.5;
    color: #b0b0b0;
}

.panel-content p {
    margin-bottom: 0.75rem;
}

.panel-content ul {
    margin-left: 1rem;
    margin-bottom: 0.75rem;
}

.panel-content li {
    margin-bottom: 0.25rem;
}

.footer {
    text-align: center;
    padding: 1rem;
    background: rgba(42, 42, 42, 0.8);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.875rem;
    color: #888;
}

.footer a {
    color: #00bfff;
    text-decoration: none;
    font-weight: 500;
}

.footer a:hover {
    color: #ff6b35;
    text-decoration: underline;
}

/* Disco mode animation */
@keyframes discoGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Responsive design */
@media (max-width: 1200px) {
    .main-container {
        grid-template-columns: 250px 1fr 250px;
    }
}

@media (max-width: 768px) {
    .main-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
        gap: 0.5rem;
    }
    
    .controls-left,
    .controls-right {
        flex-direction: row;
        overflow-x: auto;
        max-height: none;
    }
    
    .panel {
        min-width: 200px;
        flex-shrink: 0;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .shading-tabs {
        flex-direction: column;
    }
    
    .material-presets {
        justify-content: center;
    }
}

/* Smooth scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 191, 255, 0.6);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 191, 255, 0.8);
}

/* Loading animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading {
    animation: pulse 2s ease-in-out infinite;
}

/* Accessibility improvements */
button:focus,
input:focus,
select:focus {
    outline: 2px solid #00bfff;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}