/**
 * Complex Exponential Mapping Visualization Styles
 * Responsive design with scientific instrument aesthetic
 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1a3e 100%);
    color: #e0e0e0;
    line-height: 1.6;
    min-height: 100vh;
}

.complex-exponential-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    padding: 30px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

header .subtitle {
    font-size: 1.1rem;
    color: #a0a0a0;
}

/* Main Content */
main {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    margin-bottom: 40px;
}

/* Canvas Wrapper */
.canvas-wrapper {
    position: relative;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid rgba(102, 126, 234, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

#complexCanvas {
    display: block;
    width: 100%;
    height: 600px;
    cursor: crosshair;
}

#complexCanvas:active {
    cursor: grabbing;
}

.coordinate-display {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 15px;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #00ff88;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(0, 255, 136, 0.3);
}

.loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 20px 30px;
    border-radius: 10px;
    display: none;
    align-items: center;
    gap: 15px;
    z-index: 10;
}

.loading-indicator.active {
    display: flex;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Controls Panel */
.controls-panel {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    height: fit-content;
}

.control-group {
    margin-bottom: 20px;
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #b0b0b0;
    font-size: 0.95rem;
}

.control-group input[type="range"] {
    width: 100%;
    height: 6px;
    background: rgba(102, 126, 234, 0.2);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.4);
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.4);
}

.control-group select {
    width: 100%;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 5px;
    color: #e0e0e0;
    font-size: 0.95rem;
    cursor: pointer;
    outline: none;
}

.control-group select:focus {
    border-color: #667eea;
}

.control-group input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
}

.control-group input[type="checkbox"] + span {
    cursor: pointer;
    user-select: none;
}

.reset-button {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 5px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.reset-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.reset-button:active {
    transform: translateY(0);
}

.preset-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.preset-btn {
    padding: 10px 15px;
    background: rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 5px;
    color: #e0e0e0;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.preset-btn:hover {
    background: rgba(102, 126, 234, 0.3);
    border-color: #667eea;
}

/* Formula Display */
.formula-display {
    margin-top: 25px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.formula-display h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #667eea;
}

.formula-item {
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.math-formula {
    font-family: 'Times New Roman', serif;
    font-style: italic;
    color: #00ff88;
}

/* Instructions */
.instructions {
    margin-top: 25px;
    padding: 20px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.instructions h4 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: #667eea;
}

.instructions ul {
    list-style: none;
    padding-left: 0;
}

.instructions li {
    padding: 6px 0;
    font-size: 0.9rem;
    color: #b0b0b0;
}

.instructions li::before {
    content: "→ ";
    color: #667eea;
    margin-right: 8px;
}

/* Explanation Section */
.explanation {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.explanation h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #667eea;
}

.explanation h3 {
    font-size: 1.3rem;
    margin-top: 25px;
    margin-bottom: 15px;
    color: #764ba2;
}

.explanation p {
    margin-bottom: 15px;
    line-height: 1.8;
    color: #c0c0c0;
}

.explanation ul {
    list-style: none;
    padding-left: 20px;
    margin-bottom: 20px;
}

.explanation li {
    padding: 10px 0;
    line-height: 1.7;
    color: #c0c0c0;
}

.explanation li::before {
    content: "• ";
    color: #667eea;
    font-weight: bold;
    margin-right: 10px;
}

.explanation strong {
    color: #667eea;
}

/* Responsive Design */
@media (max-width: 1024px) {
    main {
        grid-template-columns: 1fr;
    }

    .canvas-wrapper {
        order: 1;
    }

    .controls-panel {
        order: 2;
    }

    #complexCanvas {
        height: 500px;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }

    header .subtitle {
        font-size: 1rem;
    }

    #complexCanvas {
        height: 400px;
    }

    .controls-panel {
        padding: 20px;
    }

    .explanation {
        padding: 20px;
    }

    .explanation h2 {
        font-size: 1.5rem;
    }

    .explanation h3 {
        font-size: 1.1rem;
    }

    .preset-buttons {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .complex-exponential-container {
        padding: 15px;
    }

    header {
        padding: 20px 15px;
    }

    #complexCanvas {
        height: 300px;
    }

    .coordinate-display {
        font-size: 0.75rem;
        padding: 6px 10px;
    }
}
