/**
 * Superellipse (Lamé Curve) Visualization Styles
 *
 * Scoped styles with .superellipse- prefix to prevent
 * conflicts with other components on the platform.
 */

/* Container */
.superellipse-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Header */
.superellipse-header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    animation: fadeInDown 0.6s ease-out;
}

.superellipse-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.superellipse-header .subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    margin: 0;
}

/* Main content area */
.superellipse-main {
    display: grid;
    gap: 20px;
    animation: fadeInUp 0.6s ease-out;
}

/* Sections */
.formula-section,
.canvas-section,
.controls-section,
.education-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Formula section */
.formula-section {
    text-align: center;
}

.formula-section h2 {
    margin: 0 0 15px 0;
    color: #667eea;
    font-size: 1.5rem;
}

.formula-display {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.formula-text {
    font-size: 1.8rem;
    font-weight: 600;
    color: #667eea;
    font-family: 'Times New Roman', Times, serif;
}

.current-values {
    font-size: 1rem;
    color: #555;
    margin-top: 10px;
}

.param-display {
    font-weight: 600;
    color: #764ba2;
    margin-left: 10px;
}

/* Canvas section */
.canvas-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.canvas-wrapper {
    position: relative;
    display: inline-block;
}

#superellipseCanvas {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    height: auto;
}

.shape-label {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(102, 126, 234, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

/* Controls section */
.controls-section h3 {
    margin: 0 0 20px 0;
    color: #667eea;
    font-size: 1.3rem;
}

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

.control-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
}

.value-display {
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.9rem;
    min-width: 50px;
    text-align: center;
}

/* Slider styling */
input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
    margin: 10px 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: #764ba2;
    transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

input[type="range"]::-moz-range-thumb:hover {
    background: #764ba2;
    transform: scale(1.1);
}

/* Special case buttons */
.special-cases {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.special-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.special-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

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

/* Education section */
.education-section h3 {
    margin: 0 0 20px 0;
    color: #667eea;
    font-size: 1.3rem;
}

.education-content p {
    line-height: 1.8;
    margin-bottom: 15px;
    color: #555;
}

.education-content ul {
    margin: 15px 0;
    padding-left: 25px;
}

.education-content li {
    line-height: 1.8;
    margin-bottom: 8px;
    color: #555;
}

.feature-list {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.applications {
    margin-top: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea10 0%, #764ba210 100%);
    border-radius: 8px;
}

.applications h4 {
    margin: 0 0 15px 0;
    color: #667eea;
    font-size: 1.1rem;
}

.application-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    list-style: none;
    padding: 0;
}

.application-list li {
    background: white;
    padding: 10px 15px;
    border-radius: 6px;
    border-left: 3px solid #764ba2;
    font-size: 0.9rem;
}

/* Footer */
.superellipse-footer {
    text-align: center;
    color: white;
    padding: 20px;
    margin-top: 20px;
    opacity: 0.9;
}

.superellipse-footer p {
    margin: 0;
    font-size: 0.95rem;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .superellipse-container {
        padding: 15px;
    }

    .superellipse-header h1 {
        font-size: 1.8rem;
    }

    .superellipse-header .subtitle {
        font-size: 0.95rem;
    }

    .formula-section,
    .canvas-section,
    .controls-section,
    .education-section {
        padding: 20px;
    }

    .formula-text {
        font-size: 1.4rem;
    }

    #superellipseCanvas {
        width: 100%;
        height: auto;
    }

    .special-cases {
        flex-direction: column;
    }

    .special-btn {
        width: 100%;
    }

    .application-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .superellipse-header h1 {
        font-size: 1.5rem;
    }

    .formula-text {
        font-size: 1.2rem;
    }

    .control-group label {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .shape-label {
        position: static;
        margin-top: 10px;
        text-align: center;
    }
}
