* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    color: #e0f7fa;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

h1 {
    font-size: 2.8rem;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #00b4db, #0083b0);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

.controls {
    background: rgba(255, 255, 255, 0.08);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 25px;
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.control-group {
    flex: 1;
    min-width: 200px;
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #80deea;
}

input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #00b4db;
    cursor: pointer;
    border: 2px solid white;
}

#reset-btn {
    background: linear-gradient(135deg, #00b4db, #0083b0);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 120px;
    justify-content: center;
}

#reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 180, 219, 0.4);
}

.fps-counter {
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 20px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.canvas-container {
    position: relative;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#bezierCanvas {
    width: 100%;
    height: 500px;
    background: rgba(0, 10, 20, 0.7);
    border-radius: 10px;
    display: block;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.instructions {
    position: absolute;
    bottom: 30px;
    left: 30px;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #00b4db;
}

.instructions p {
    margin: 8px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.info-box {
    background: rgba(255, 255, 255, 0.05);
    padding: 25px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.info-box h3 {
    color: #80deea;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.formula {
    font-family: 'Courier New', monospace;
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 8px;
    font-size: 1.1rem;
    color: #ffcc80;
    text-align: center;
}

footer {
    text-align: center;
    padding: 20px;
    margin-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.8;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    h1 {
        font-size: 2rem;
        flex-direction: column;
        gap: 10px;
    }
    
    #bezierCanvas {
        height: 400px;
    }
}


/* Performance warning animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Quality display styling */
.quality-display {
  background: rgba(0, 0, 0, 0.3);
  padding: 10px 15px;
  border-radius: 8px;
  font-family: monospace;
  font-size: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* FPS counter with color states */
.fps-counter {
  transition: color 0.3s ease;
}

/* Add responsive adjustments for new quality display */
@media (max-width: 768px) {
  .quality-display {
    order: 4; /* Move to end on mobile */
    width: 100%;
    text-align: center;
    margin-top: 10px;
  }
  
  .controls {
    gap: 15px;
  }
}