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

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

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

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: rgba(26, 26, 46, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
    gap: 1rem;
}

.title {
    font-size: 2rem;
    font-weight: 300;
    background: linear-gradient(45deg, #00d4ff, #ff00ff, #ffff00);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.fractal-selector {
    display: flex;
    gap: 0.5rem;
}

.fractal-btn {
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.fractal-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #00d4ff;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
}

.fractal-btn.active {
    background: linear-gradient(45deg, #00d4ff, #0099cc);
    border-color: #00d4ff;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

.zoom-display {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    color: #00ff88;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

/* Main Area */
.main-area {
    display: flex;
    flex: 1;
    position: relative;
    gap: 1rem;
    padding: 1rem;
}

.canvas-container {
    flex: 1;
    position: relative;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#fractal-canvas {
    display: block;
    width: 100%;
    height: auto;
    cursor: crosshair;
}

.crosshair {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid #00ff88;
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    opacity: 0.7;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.8);
    padding: 2rem;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #00d4ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Control Panel */
.control-panel {
    width: 300px;
    background: rgba(26, 26, 46, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    height: fit-content;
    max-height: 80vh;
    overflow-y: auto;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-header h3 {
    margin: 0;
    color: #00d4ff;
}

.toggle-btn {
    background: none;
    border: none;
    color: #00d4ff;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.panel-content {
    padding: 1rem;
}

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

.control-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #cccccc;
    font-size: 0.9rem;
}

.control-group input[type="range"] {
    width: 100%;
    margin: 0.5rem 0;
    accent-color: #00d4ff;
}

.control-group select {
    width: 100%;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    font-size: 0.9rem;
}

.control-group select option {
    background: #1a1a2e;
    color: white;
}

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

.julia-controls h4 {
    color: #ff00ff;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.julia-presets {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.preset-btn {
    padding: 0.5rem 0.75rem;
    background: rgba(255, 0, 255, 0.2);
    border: 1px solid rgba(255, 0, 255, 0.4);
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.preset-btn:hover {
    background: rgba(255, 0, 255, 0.4);
    box-shadow: 0 0 10px rgba(255, 0, 255, 0.3);
}

.navigation-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.nav-btn {
    padding: 0.75rem;
    background: rgba(0, 212, 255, 0.2);
    border: 1px solid rgba(0, 212, 255, 0.4);
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: rgba(0, 212, 255, 0.4);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
}

.info-panel h4 {
    color: #00ff88;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.coordinates, .performance {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #cccccc;
    margin-bottom: 0.5rem;
}

.coordinates span, .performance span {
    display: block;
    margin-bottom: 0.25rem;
}

.famous-locations {
    margin-top: 1.5rem;
}

.famous-locations h4 {
    color: #ffff00;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.location-btn {
    display: block;
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 0, 0.1);
    border: 1px solid rgba(255, 255, 0, 0.3);
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-align: left;
}

.location-btn:hover {
    background: rgba(255, 255, 0, 0.2);
    box-shadow: 0 0 10px rgba(255, 255, 0, 0.3);
}

/* Footer */
.footer {
    padding: 1rem 2rem;
    background: rgba(26, 26, 46, 0.9);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    font-size: 0.9rem;
    color: #cccccc;
}

.footer a {
    color: #00d4ff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #ffffff;
    text-shadow: 0 0 5px rgba(0, 212, 255, 0.5);
}

.math-info {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    opacity: 0.7;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .title {
        font-size: 1.5rem;
    }

    .main-area {
        flex-direction: column;
        padding: 0.5rem;
    }

    .control-panel {
        width: 100%;
        max-height: none;
    }

    .navigation-controls {
        grid-template-columns: 1fr;
    }

    .julia-presets {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 1rem;
    }

    .fractal-selector {
        flex-direction: column;
        width: 100%;
    }

    .fractal-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    .panel-content {
        padding: 0.75rem;
    }

    .footer {
        padding: 1rem;
        font-size: 0.8rem;
    }
}

/* Custom scrollbar */
.control-panel::-webkit-scrollbar {
    width: 6px;
}

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

.control-panel::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.5);
    border-radius: 3px;
}

.control-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 212, 255, 0.7);
}