* {
    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;
    color: #333;
}

.electric-power-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, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

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

main {
    padding: 30px;
}

/* Simulation Layout */
.simulation-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

/* Circuit Panel */
.circuit-panel {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.circuit-panel h3 {
    color: #1e3c72;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.circuit-display {
    background: #1a1a2e;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

#circuitCanvas {
    width: 100%;
    height: auto;
    display: block;
}

/* Real-time Values */
.realtime-values {
    background: white;
    border-radius: 10px;
    padding: 20px;
}

.realtime-values h4 {
    color: #2a5298;
    margin-bottom: 15px;
}

.values-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.value-item {
    display: flex;
    flex-direction: column;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.value-item.highlight {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
    color: white;
    border-left-color: #ff6b6b;
}

.value-item span:first-child {
    font-size: 0.9rem;
    margin-bottom: 5px;
    opacity: 0.8;
}

.value-display {
    font-size: 1.5rem;
    font-weight: bold;
}

/* Controls Panel */
.controls-panel {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.controls-panel h4 {
    color: #1e3c72;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

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

.control-group label {
    display: block;
    margin-bottom: 10px;
    color: #333;
    font-weight: 500;
}

.control-group label span:last-child {
    color: #667eea;
    font-weight: bold;
}

input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #d3d3d3;
    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;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
}

select {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
}

/* Preset Buttons */
.preset-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.preset-btn {
    padding: 12px;
    background: white;
    border: 2px solid #667eea;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.preset-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

/* Formulas Section */
.formulas-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.formulas-section h3 {
    color: #1e3c72;
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.8rem;
}

.formulas-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.formula-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border-top: 4px solid #667eea;
}

.formula-card.active {
    border-top-color: #ff6b6b;
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.3);
}

.formula-card h4 {
    color: #1e3c72;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.formula-card p {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
}

.formula-calculation {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #333;
}

.formula-usage {
    font-size: 0.85rem;
    color: #888;
    font-style: italic;
}

/* Energy Section */
.energy-section {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    color: white;
}

.energy-section h3 {
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.8rem;
}

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

.energy-controls .control-group {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.energy-controls label {
    color: white;
}

.energy-results {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 15px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    padding: 15px 20px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.result-item.highlight {
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.result-value {
    font-size: 1.8rem;
    font-weight: bold;
}

/* Joule Heating Section */
.joule-section {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    color: white;
}

.joule-section h3 {
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.8rem;
}

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

.heating-animation {
    display: flex;
    align-items: center;
    justify-content: center;
}

.resistor-heating {
    width: 100%;
    height: 200px;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    background: #2d2d44;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

.heat-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(to right, #4ecdc4, #44a08d);
    transition: background 0.5s ease;
}

.temperature-display {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-align: center;
}

.temperature-display span:first-child {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.temperature-display span:last-child {
    display: block;
    font-size: 2rem;
    font-weight: bold;
}

.joule-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.formula-display {
    background: rgba(255, 255, 255, 0.2);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.formula-display h4 {
    margin-bottom: 10px;
}

.joule-calculation {
    background: rgba(255, 255, 255, 0.15);
    padding: 15px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.calc-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.calc-row:last-child {
    border-bottom: none;
}

/* Education Section */
.education-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.education-section h3 {
    color: #1e3c72;
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.8rem;
}

.education-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.education-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #667eea;
}

.education-card h4 {
    color: #1e3c72;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.education-card p {
    color: #666;
    line-height: 1.6;
}

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

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

    .energy-layout,
    .joule-layout {
        grid-template-columns: 1fr;
    }

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

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

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

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

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

    main {
        padding: 15px;
    }
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(102, 126, 234, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.8);
    }
}

.glow {
    animation: glow 2s infinite;
}
