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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 30px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    color: white;
}

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

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

/* Main Content */
.main-content {
    margin-bottom: 20px;
}

/* Controls Section */
.controls-section {
    margin-bottom: 20px;
}

.controls-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

/* Secondary Controls - Horizontal Layout */
.secondary-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.control-card.compact {
    padding: 15px;
}

.control-card.compact h3 {
    font-size: 1.1em;
    margin-bottom: 10px;
}

/* Canvas Section */
.canvas-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.canvas-container {
    background: #000;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 20px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

#shadowCanvas {
    display: block;
    width: 100%;
    height: 500px;
    border-radius: 5px;
    background: #1a1a2e;
}

/* Legend */
.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 30px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid #333;
}

.legend-color.umbra {
    background: #000;
}

.legend-color.penumbra {
    background: linear-gradient(to right, #000, #666);
}

.legend-color.light {
    background: #ffeb3b;
}

.legend-color.object {
    background: #4a5568;
}
.control-card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.control-card h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.3em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 8px;
}

.control-item {
    margin-bottom: 15px;
}

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

.value-display {
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: bold;
}

input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

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

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

/* Radio Group */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px;
    background: white;
    border-radius: 8px;
    transition: background 0.3s;
}

.radio-group label:hover {
    background: #e9ecef;
}

.radio-group input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

/* Checkbox */
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 8px;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}

.checkbox-item:hover {
    background: #e9ecef;
}

.checkbox-item input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.checkbox-item label {
    cursor: pointer;
    margin: 0;
    flex: 1;
}

/* Buttons */
.animation-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.control-btn {
    flex: 1;
    padding: 12px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.control-btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.6);
}

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

/* Information Section */
.info-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.info-card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.info-card h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.3em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 8px;
}

/* Formula Display */
.formula-display {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.formula-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.formula-label {
    font-weight: 600;
    color: #333;
}

.formula {
    font-family: 'Courier New', monospace;
    font-size: 1.1em;
    color: #667eea;
    font-weight: bold;
}

.formula-value {
    font-family: 'Courier New', monospace;
    font-size: 1.1em;
    color: #28a745;
    font-weight: bold;
}

/* Eclipse Display */
.eclipse-display {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.eclipse-item {
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.eclipse-label {
    font-weight: 600;
    color: #333;
}

.eclipse-value {
    font-size: 1.2em;
    color: #667eea;
    font-weight: bold;
}

.eclipse-description {
    padding: 15px;
    background: #fff3cd;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
}

.eclipse-description p {
    margin: 0;
    color: #856404;
}

/* Params Display */
.params-display {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.param-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.param-label {
    font-weight: 600;
    color: #555;
}

.param-value {
    font-family: 'Courier New', monospace;
    color: #667eea;
    font-weight: bold;
}

/* Educational Content */
.educational-content {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.education-section {
    margin-bottom: 25px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.education-section h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.4em;
}

.education-section p {
    line-height: 1.8;
    color: #333;
    text-align: justify;
}

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

/* Responsive Design */
@media (max-width: 1200px) {
    .controls-row {
        grid-template-columns: 1fr;
    }
}

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

    header h1 {
        font-size: 1.8em;
    }

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

    #shadowCanvas {
        height: 350px;
    }

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

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

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

    .legend {
        flex-direction: column;
    }
}