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

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
}

.header {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid #00ffff;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 255, 255, 0.3);
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(45deg, #00ffff, #ff00ff, #ffff00);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient 3s ease infinite;
}

.header p {
    color: #cccccc;
    font-size: 1.1rem;
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.app-container {
    display: flex;
    height: calc(100vh - 120px);
    gap: 1rem;
    padding: 1rem;
}

.sidebar {
    width: 250px;
    background: rgba(20, 20, 40, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(0, 255, 255, 0.3);
    padding: 1rem;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.sidebar.left {
    order: 1;
}

.sidebar.right {
    order: 3;
}

.canvas-container {
    flex: 1;
    order: 2;
    background: rgba(10, 10, 20, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 2px solid #00ffff;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.canvas-header {
    background: rgba(0, 0, 0, 0.8);
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 255, 255, 0.3);
}

.coordinates {
    display: flex;
    gap: 2rem;
    font-family: 'Courier New', monospace;
    color: #00ffff;
}

.canvas-controls {
    display: flex;
    gap: 0.5rem;
}

.canvas-footer {
    background: rgba(0, 0, 0, 0.8);
    padding: 0.5rem 1rem;
    display: flex;
    gap: 1rem;
    border-top: 1px solid rgba(0, 255, 255, 0.3);
}

#canvas {
    flex: 1;
    background: #000000;
    cursor: crosshair;
    display: block;
}

.panel {
    background: rgba(30, 30, 50, 0.6);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.panel h3 {
    color: #00ffff;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.tool-btn {
    background: rgba(0, 255, 255, 0.1);
    border: 2px solid rgba(0, 255, 255, 0.3);
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #ffffff;
}

.tool-btn:hover {
    background: rgba(0, 255, 255, 0.2);
    border-color: #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.4);
    transform: translateY(-2px);
}

.tool-btn.active {
    background: rgba(0, 255, 255, 0.3);
    border-color: #00ffff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.6);
}

.action-btn {
    background: linear-gradient(45deg, #ff00ff, #00ffff);
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: #ffffff;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-bottom: 0.5rem;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 0, 255, 0.4);
}

.action-btn.danger {
    background: linear-gradient(45deg, #ff0040, #ff4000);
}

.icon-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 0.5rem;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

label {
    display: block;
    margin: 0.5rem 0 0.2rem 0;
    color: #cccccc;
    font-size: 0.9rem;
}

input[type="color"] {
    width: 100%;
    height: 40px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 0.5rem;
}

input[type="range"] {
    width: 100%;
    margin-bottom: 0.5rem;
}

textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 6px;
    padding: 0.5rem;
    color: #00ffff;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    resize: vertical;
    margin-bottom: 0.5rem;
}

.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.tutorial-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 2px solid #00ffff;
    border-radius: 20px;
    padding: 2rem;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 0 50px rgba(0, 255, 255, 0.5);
}

.tutorial-content h2 {
    color: #00ffff;
    margin-bottom: 1rem;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.tutorial-content ul {
    text-align: left;
    margin: 1rem 0;
    padding-left: 1rem;
}

.tutorial-content li {
    margin: 0.5rem 0;
    color: #cccccc;
}

.animation-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

#vector-info {
    font-size: 0.9rem;
    line-height: 1.4;
}

#vector-info p {
    margin-bottom: 0.8rem;
    padding: 0.5rem;
    background: rgba(0, 255, 255, 0.1);
    border-radius: 6px;
    border-left: 3px solid #00ffff;
}

.footer {
    background: rgba(0, 0, 0, 0.8);
    border-top: 1px solid rgba(0, 255, 255, 0.3);
    padding: 1rem;
    text-align: center;
    color: #cccccc;
}

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

.footer a:hover {
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .app-container {
        flex-direction: column;
        height: auto;
    }
    
    .sidebar {
        width: 100%;
        order: unset;
    }
    
    .canvas-container {
        order: unset;
        height: 600px;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #00ffff, #ff00ff);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #ff00ff, #ffff00);
}