* {
    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, #065f46 0%, #059669 100%);
    min-height: 100vh;
    padding: 20px;
}

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

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

header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 10px;
}

header .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    padding: 30px;
}

.canvas-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.canvas-section h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 15px;
}

.canvas-section canvas {
    width: 100%;
    background: #f8fafc;
    border-radius: 8px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    cursor: crosshair;
    touch-action: none;
}

.canvas-info {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #ecfdf5;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #475569;
    border: 1px solid #a7f3d0;
}

.info-item span:last-child {
    color: #059669;
    font-weight: 700;
}

.controls-panel {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.controls-panel h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #065f46;
    margin-bottom: 20px;
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

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

.control-group h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #059669;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #a7f3d0;
}

.control-group label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
    margin-top: 12px;
    font-size: 0.85rem;
}

.control-group label span:last-child {
    color: #059669;
    font-weight: 700;
}

.select-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    color: #374151;
    outline: none;
    transition: border-color 0.2s;
}

.select-input:focus {
    border-color: #059669;
}

.control-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e2e8f0;
    outline: none;
    -webkit-appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #059669;
    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;
    border-radius: 50%;
    background: #059669;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.checkbox-input {
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: #059669;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.control-btn {
    flex: 1;
    padding: 10px 15px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.control-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.formulas-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-top: 20px;
}

.formulas-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #065f46;
    margin-bottom: 15px;
}

.formula-list {
    display: grid;
    gap: 12px;
}

.formula-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: #ecfdf5;
    border-radius: 6px;
}

.formula-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    min-width: 180px;
}

.formula {
    font-family: 'Times New Roman', serif;
    font-size: 0.95rem;
    color: #059669;
    font-style: italic;
}

.instructions {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-top: 15px;
}

.instructions h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #059669;
    margin-bottom: 10px;
}

.instructions ul {
    list-style-position: inside;
    padding-left: 10px;
}

.instructions li {
    font-size: 0.85rem;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 5px;
}

.explanation {
    padding: 30px;
    background: #fafafa;
    border-top: 1px solid #e5e7eb;
}

.explanation h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #065f46;
    margin-bottom: 15px;
}

.explanation h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #059669;
    margin: 20px 0 10px;
}

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

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 1.6rem;
    }

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

    main {
        padding: 15px;
    }

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

    .formula-label {
        min-width: auto;
    }

    .formula-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .canvas-info {
        flex-direction: column;
        gap: 10px;
    }
}
