/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #4c63d2;
}

.logo-microbit {
    transform: scale(0.4);
    transform-origin: center;
}

.logo-microbit .microbit-board {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.logo-microbit .led-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 3px;
    margin-bottom: 8px;
}

.logo-microbit .led-row {
    display: contents;
}

.logo-microbit .led {
    width: 8px;
    height: 8px;
    background: #333;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.logo-microbit .led.active {
    background: #ff6b6b;
    box-shadow: 0 0 8px #ff6b6b;
}

.logo-microbit .buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
}

.logo-microbit .microbit-btn {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #1976D2;
    color: white;
    border: none;
    font-size: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logo:hover .logo-microbit {
    transform: scale(0.45);
}

/* Cart Badge Styles */
.cart-link {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(255, 68, 68, 0.4);
    transition: all 0.3s ease;
}

.cart-badge:not(.hidden):hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 68, 68, 0.6);
}

.cart-badge.hidden {
    display: none;
}

/* Main Content */
.main {
    min-height: calc(100vh - 80px);
}

.section {
    padding: 60px 0;
}

/* Home Section */
.home-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    min-height: 500px;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 20px;
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #ff6b6b;
    color: white;
}

.btn-primary:hover {
    background: #ff5252;
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.9);
    color: #4c63d2;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: #4c63d2;
    color: white;
    border-color: #4c63d2;
}

.btn-disabled {
    background: #ccc;
    color: #666;
    cursor: not-allowed;
}

.btn-success {
    background: #4caf50;
    color: white;
}

.btn-success:hover {
    background: #45a049;
}

/* Micro:bit Simulator */
.microbit-simulator {
    display: flex;
    justify-content: center;
    align-items: center;
}

.microbit-board {
    background: #1a1a1a;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transform: scale(1.2);
}

.led-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.led-row {
    display: contents;
}

.led {
    width: 20px;
    height: 20px;
    background: #333;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.led.active {
    background: #ff6b6b;
    box-shadow: 0 0 20px #ff6b6b;
}

.buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.microbit-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #4c63d2;
    color: white;
    border: none;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.microbit-btn:hover {
    background: #3f51b5;
    transform: scale(1.1);
}

/* Lessons Section */
.lessons-section {
    background: white;
}

.lessons-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    color: #333;
}

.lessons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.lesson-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.lesson-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.lesson-header {
    display: flex;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.lesson-icon {
    width: 60px;
    height: 60px;
    background: #4c63d2;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    margin-right: 15px;
}

.lesson-info {
    flex: 1;
}

.lesson-info h3 {
    font-size: 1.3rem;
    margin-bottom: 5px;
    color: #333;
}

.lesson-info p {
    color: #666;
    font-size: 0.9rem;
}

.lesson-status {
    font-size: 1.5rem;
}

.lesson-status .completed {
    color: #4caf50;
}

.lesson-status .pending {
    color: #ff9800;
}

.lesson-status .locked {
    color: #ccc;
}

.lesson-content {
    padding: 20px;
}

.lesson-content p {
    margin-bottom: 15px;
    color: #666;
}

.lesson-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.lesson-actions {
    padding: 0 20px 20px;
    display: flex;
    gap: 10px;
}

.lesson-actions .btn {
    flex: 1;
    padding: 12px 20px;
    font-size: 0.9rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
}

.modal-content {
    background: white;
    margin: 2% auto;
    padding: 0;
    border-radius: 20px;
    width: 95%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    background: linear-gradient(135deg, #4c63d2 0%, #667eea 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.8rem;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 0;
    max-height: calc(90vh - 140px);
    overflow-y: auto;
}

.lesson-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 600px;
}

.lesson-instructions {
    padding: 30px;
    background: #f8f9fa;
    border-right: 1px solid #e9ecef;
}

.lesson-workspace {
    padding: 30px;
    background: white;
}

.step-by-step {
    margin-top: 20px;
}

.step {
    display: flex;
    margin-bottom: 20px;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    opacity: 0.6;
    transition: all 0.3s ease;
}

.step.active {
    opacity: 1;
    border-left: 4px solid #4c63d2;
}

.step-number {
    width: 40px;
    height: 40px;
    background: #4c63d2;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 15px;
    flex-shrink: 0;
}

.step-content h4 {
    margin-bottom: 8px;
    color: #333;
}

.step-content p {
    color: #666;
    line-height: 1.6;
}

.makecode-container {
    background: #f5f5f5;
    border-radius: 15px;
    padding: 40px;
    margin-bottom: 30px;
    text-align: center;
    border: 2px dashed #ddd;
}

.makecode-placeholder {
    color: #666;
}

.makecode-placeholder i {
    font-size: 3rem;
    margin-bottom: 10px;
    color: #4c63d2;
}

.makecode-placeholder p {
    margin-bottom: 5px;
}

.makecode-placeholder .small-text {
    font-size: 0.9rem;
    color: #999;
}

.simulator-container {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
}

.simulator-container h4 {
    margin-bottom: 20px;
    color: #333;
}

.interactive-microbit {
    background: #1a1a1a;
    border-radius: 20px;
    padding: 30px;
    display: inline-block;
}

.microbit-display {
    margin-bottom: 20px;
}

.led-matrix {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin-bottom: 20px;
}

.led-matrix .led {
    width: 16px;
    height: 16px;
    background: #333;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.led-matrix .led.active {
    background: #ff6b6b;
    box-shadow: 0 0 15px #ff6b6b;
}

.microbit-controls {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.sim-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #4c63d2;
    color: white;
    border: none;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.sim-btn:hover {
    background: #3f51b5;
    transform: scale(1.1);
}

.sim-btn:active {
    transform: scale(0.95);
}

.modal-footer {
    background: #f8f9fa;
    padding: 20px 30px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Projects Section */
.projects-section {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.projects-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.project-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.project-image {
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

.project-info {
    padding: 20px;
    color: #333;
}

.project-info h3 {
    margin-bottom: 8px;
    font-size: 1.3rem;
}

.project-info p {
    color: #666;
    margin-bottom: 15px;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.add-project {
    background: rgba(255, 255, 255, 0.1);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-project:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.add-project-content {
    text-align: center;
    color: white;
}

.add-project-content i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.7;
}

.add-project-content h3 {
    margin-bottom: 10px;
}

.add-project-content p {
    opacity: 0.8;
}

/* Progress Section */
.progress-section {
    background: white;
}

.progress-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    color: #333;
}

.progress-overview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

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

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.stat-info h3 {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.stat-info p {
    opacity: 0.9;
}

.progress-chart {
    background: #f8f9fa;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
}

.chart-container {
    width: 100%;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 1.2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .nav {
        display: none;
    }
    
    .lesson-layout {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 98%;
        margin: 1% auto;
    }
    
    .progress-overview {
        grid-template-columns: 1fr;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-buttons .btn {
        width: 200px;
    }
}