/* Lissajous Figures Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
        'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.lissajous-container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

header .subtitle {
    font-size: 1.1em;
    opacity: 0.95;
}

main {
    padding: 30px;
}

.simulation-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.left-panel, .right-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.canvas-display, .controls-section, .equations-section, .presets-section {
    background: linear-gradient(145deg, #f8fafc, #e2e8f0);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.canvas-display h3, .controls-section h3, .equations-section h3, .presets-section h3 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 1.3em;
    border-bottom: 3px solid #667eea;
    padding-bottom: 8px;
}

#lissajousCanvas {
    width: 100%;
    height: 500px;
    background: #0a0a1a;
    border-radius: 10px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

.pattern-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 15px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 10px;
    background: #f7fafc;
    border-radius: 8px;
    font-size: 0.9em;
}

.info-item span:first-child {
    font-weight: 600;
    color: #4a5568;
    font-size: 0.85em;
}

.info-item span:last-child {
    font-weight: 700;
    color: #667eea;
    font-size: 1.1em;
}

.control-group {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 12px;
}

.control-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.9em;
}

.control-group input[type="range"] {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    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 4px rgba(0, 0, 0, 0.2);
}

.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 4px rgba(0, 0, 0, 0.2);
}

.equation-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.equation-item {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.equation {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: 1.2em;
    color: #2d3748;
}

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

.preset-btn {
    padding: 12px 16px;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border: 2px solid #cbd5e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
    font-weight: 600;
    color: #4a5568;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.preset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.preset-btn:active {
    transform: translateY(0);
}

.explanation {
    background: linear-gradient(145deg, #f8fafc, #e2e8f0);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.explanation h2 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.8em;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

.explanation h3 {
    color: #2d3748;
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1.4em;
}

.explanation p {
    color: #4a5568;
    line-height: 1.8;
    font-size: 1.05em;
    margin-bottom: 15px;
}

.explanation strong {
    color: #667eea;
    font-weight: 700;
}

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

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

    header h1 {
        font-size: 2em;
    }
}

@media (max-width: 768px) {
    .lissajous-container {
        border-radius: 10px;
    }

    main {
        padding: 15px;
    }

    .pattern-info {
        grid-template-columns: 1fr;
    }

    #lissajousCanvas {
        height: 400px;
    }

    header h1 {
        font-size: 1.5em;
    }

    header .subtitle {
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    header .subtitle {
        font-size: 0.85em;
    }

    .explanation {
        padding: 15px;
    }

    .explanation h2 {
        font-size: 1.4em;
    }
}
