/* Physics Section Styles */

.physics-content {
    padding: 2rem 0;
}

.intro-section {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
}

.intro-section h2 {
    margin-bottom: 1rem;
    font-size: 2rem;
}

.intro-section p {
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Topics Grid */
.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.topic-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
    display: flex;
    flex-direction: column;
}

.topic-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.topic-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.topic-card h3 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.topic-card p {
    color: #555;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    flex-grow: 1;
}

/* Lesson Content */
.lesson-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.lesson-section {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.intro-box {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.intro-box h2 {
    color: white;
    margin-bottom: 1rem;
}

.intro-box p {
    font-size: 1.1rem;
    line-height: 1.8;
}

/* Concept Headers */
.concept-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid #667eea;
}

.concept-icon {
    font-size: 3rem;
}

.concept-header h2 {
    color: #667eea;
    margin: 0;
}

.concept-content {
    line-height: 1.8;
}

.concept-content > p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: #333;
}

.concept-content strong {
    color: #667eea;
}

/* Special Boxes */
.analogy-box,
.example-box,
.formula-box,
.safety-note,
.fun-fact,
.green-box {
    margin: 1.5rem 0;
    padding: 1.5rem;
    border-radius: 10px;
    border-left: 4px solid;
}

.analogy-box {
    background: #e3f2fd;
    border-left-color: #2196f3;
}

.analogy-box h3 {
    color: #1976d2;
    margin-bottom: 0.75rem;
}

.example-box {
    background: #f3e5f5;
    border-left-color: #9c27b0;
}

.example-box h3 {
    color: #7b1fa2;
    margin-bottom: 0.75rem;
}

.example-box ul {
    margin: 0.5rem 0 0 1.5rem;
}

.example-box li {
    margin: 0.5rem 0;
}

.formula-box {
    background: #fff3e0;
    border-left-color: #ff9800;
}

.formula-box h3 {
    color: #f57c00;
    margin-bottom: 0.75rem;
}

.formula {
    font-size: 1.3rem;
    font-weight: bold;
    color: #e65100;
    text-align: center;
    margin: 1rem 0;
    padding: 0.75rem;
    background: white;
    border-radius: 8px;
}

.safety-note {
    background: #ffebee;
    border-left-color: #f44336;
}

.safety-note strong {
    color: #c62828;
    display: block;
    margin-bottom: 0.5rem;
}

.fun-fact {
    background: #e8f5e9;
    border-left-color: #4caf50;
}

.fun-fact strong {
    color: #2e7d32;
}

.green-box {
    background: #e8f5e9;
    border-left-color: #4caf50;
}

.green-box strong {
    color: #2e7d32;
    display: block;
    margin-bottom: 0.5rem;
}

/* Circuit Explanation */
.highlight-section {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
}

.highlight-section h2 {
    color: #2d3436;
    margin-bottom: 1rem;
}

.circuit-explanation p {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #2d3436;
}

.circuit-explanation h3 {
    color: #2d3436;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.circuit-parts {
    list-style: none;
    padding: 0;
}

.circuit-parts li {
    background: white;
    padding: 1rem;
    margin: 0.75rem 0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.circuit-types {
    margin-top: 2rem;
}

.circuit-type-box {
    background: white;
    padding: 1.5rem;
    margin: 1rem 0;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.circuit-type-box h4 {
    color: #667eea;
    margin-bottom: 0.5rem;
}

/* Summary Section */
.summary-section {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.summary-section h2 {
    color: #2d3436;
    text-align: center;
    margin-bottom: 2rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.summary-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.summary-card:hover {
    transform: translateY(-3px);
}

.summary-card h3 {
    color: #667eea;
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
}

.summary-card p {
    color: #555;
    font-size: 0.95rem;
}

/* Activity Section */
.activity-section {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.activity-section h2 {
    color: white;
    text-align: center;
    margin-bottom: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.activity-list {
    display: grid;
    gap: 1rem;
}

.activity-item {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.activity-item h3 {
    color: #667eea;
    margin-bottom: 0.75rem;
}

.activity-item p {
    color: #555;
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .concept-header {
        flex-direction: column;
        text-align: center;
    }

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

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

    .lesson-content {
        padding: 1rem 0.5rem;
    }

    .lesson-section {
        padding: 1.5rem;
    }
}

/* Circuit Playground Styles */
.playground-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2.5rem;
}

.playground-section h2 {
    color: white;
    text-align: center;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.playground-intro {
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: white;
}

.playground-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Component Palette */
.component-palette {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1rem;
}

.component-palette h3 {
    color: #667eea;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    text-align: center;
}

.palette-items {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.component-item {
    background: white;
    border: 2px solid #ddd;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    text-align: center;
    cursor: grab;
    transition: all 0.3s;
    user-select: none;
    min-width: 100px;
}

.component-item:hover {
    border-color: #667eea;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.component-item:active {
    cursor: grabbing;
}

.component-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.component-item span {
    display: block;
    color: #333;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Controls Section */
.controls-section {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.controls-section h3 {
    width: 100%;
    color: #667eea;
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.control-group {
    flex: 1;
    min-width: 200px;
}

.control-group label {
    display: block;
    color: #333;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.control-group input[type="range"] {
    width: 100%;
    margin-bottom: 0.5rem;
}

.control-group span {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 5px;
    font-weight: bold;
}

.control-btn {
    padding: 0.75rem 1.5rem;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    white-space: nowrap;
}

.control-btn:hover {
    background: #d32f2f;
}

/* Readings Section */
.readings-section {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.readings-section h3 {
    width: 100%;
    color: #667eea;
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.reading-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    flex: 1;
    min-width: 150px;
}

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

.reading-value {
    color: #667eea;
    font-weight: bold;
    font-size: 1.1rem;
}

.status-message {
    margin-top: 1rem;
    padding: 1rem;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.status-message.error {
    background: #ffebee;
    color: #c62828;
}

.status-message.success {
    background: #e8f5e9;
    color: #2e7d32;
}

/* Circuit Board */
.circuit-board {
    background: #fff;
    border-radius: 10px;
    border: 3px solid #667eea;
    padding: 1.5rem;
    min-height: 600px;
    position: relative;
    transition: all 0.3s;
    flex: 1;
}

.circuit-board.drag-over {
    border-color: #4caf50;
    background: #f1f8f4;
}

.board-title {
    text-align: center;
    color: #667eea;
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
}

.board-grid {
    min-height: 400px;
    background-image: 
        linear-gradient(rgba(102, 126, 234, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(102, 126, 234, 0.1) 1px, transparent 1px);
    background-size: 30px 30px;
    border-radius: 8px;
    position: relative;
    transition: all 0.3s;
}

.board-grid.drag-over {
    background-color: rgba(76, 175, 80, 0.05);
}

#wire-canvas {
    position: absolute;
    top: 60px;
    left: 1.5rem;
    right: 1.5rem;
    bottom: 1.5rem;
    pointer-events: auto;
    z-index: 1;
}

/* Placed Components */
.placed-component {
    position: absolute;
    background: white;
    border: 2px solid #667eea;
    border-radius: 6px;
    padding: 0.35rem 0.5rem;
    text-align: center;
    cursor: move;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 2;
    user-select: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    position: relative;
    width: 60px;
}

.placed-component:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.placed-component.active {
    border-color: #4caf50;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.5);
}

/* Connection Points */
.connection-point {
    position: absolute;
    width: 16px;
    height: 16px;
    background: #667eea;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0;
    z-index: 3;
    transition: all 0.3s;
}

.connection-point:first-of-type {
    top: 50%;
    left: -8px;
    transform: translateY(-50%);
}

.connection-point:last-of-type {
    top: 50%;
    right: -8px;
    transform: translateY(-50%);
}

.connection-point:hover {
    background: #ff9800;
    transform: translateY(-50%) scale(1.3);
    box-shadow: 0 0 10px rgba(255, 152, 0, 0.6);
}

.connection-point.selected {
    background: #ff9800;
    animation: pulse-point 0.8s infinite;
    box-shadow: 0 0 15px rgba(255, 152, 0, 0.8);
}

@keyframes pulse-point {
    0%, 100% {
        transform: translateY(-50%) scale(1.2);
    }
    50% {
        transform: translateY(-50%) scale(1.5);
    }
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 152, 0, 0.6);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 152, 0, 0.8);
    }
}

.placed-component .component-icon {
    font-size: 1.25rem;
    margin-bottom: 0.1rem;
    line-height: 1;
}

.placed-component .component-label {
    display: block;
    color: #333;
    font-weight: 600;
    font-size: 0.65rem;
    line-height: 1;
}

.placed-component .remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.placed-component .remove-btn:hover {
    background: #d32f2f;
}

.placed-component .connect-btn {
    position: absolute;
    bottom: -10px;
    right: -10px;
    width: 28px;
    height: 28px;
    background: #2196f3;
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.placed-component .connect-btn:hover {
    background: #1976d2;
    transform: scale(1.1);
}

/* Bulb States */
.bulb-icon.bulb-on {
    filter: brightness(1.5) drop-shadow(0 0 10px yellow);
    animation: glow 1s infinite alternate;
}

@keyframes glow {
    from {
        filter: brightness(1.5) drop-shadow(0 0 10px yellow);
    }
    to {
        filter: brightness(2) drop-shadow(0 0 20px yellow);
    }
}

/* Switch States */
.switch-icon.switch-on {
    color: #4caf50;
}

.switch-icon.switch-off {
    color: #999;
}

/* Current Flow Animation */
@keyframes flow {
    0% {
        stroke-dashoffset: 0;
    }
    100% {
        stroke-dashoffset: -20;
    }
}

.current-flow {
    stroke-dasharray: 10, 10;
    animation: flow 1s linear infinite;
}

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

    .component-palette {
        max-width: 100%;
    }

    .palette-items {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .playground-section {
        padding: 1.5rem;
    }

    .playground-container {
        padding: 1rem;
    }

    .palette-items {
        grid-template-columns: repeat(2, 1fr);
    }

    .circuit-board {
        min-height: 400px;
    }
}
