/* File: css/robotics.css | System: Elorm Academy Learning Arena */

:root {
    --primary: #00e5ff;
    --accent: #ff4081;
    --neon-yellow: #ffe600;
    --neon-green: #00ffcc;
    --bg-dark: #090d16;
    --card-bg: rgba(15, 23, 42, 0.82);
    --border-glow: rgba(0, 229, 255, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: #f8fafc;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 25px 15px;
    overflow-x: hidden;
    position: relative;
}

/* ============================================================================
   1. GLOBAL SPACE BACKGROUND ANIMATION
   ============================================================================ */
.space-background {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: -1;
    background: radial-gradient(circle at 50% 30%, #1e1b4b 0%, #090d16 70%);
    overflow: hidden;
}

.stars, .twinkling {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%;
    display: block;
}

.stars {
    background: #000 url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200"><circle cx="20" cy="30" r="1" fill="%23fff" opacity="0.8"/><circle cx="150" cy="80" r="1.5" fill="%2300e5ff" opacity="0.9"/><circle cx="90" cy="140" r="1" fill="%23ffe600" opacity="0.7"/><circle cx="180" cy="170" r="1.2" fill="%23fff" opacity="0.6"/></svg>') repeat;
    z-index: 1;
}

.twinkling {
    background: transparent url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="300" height="300" viewBox="0 0 300 300"><circle cx="50" cy="50" r="2" fill="%23ff4081" opacity="0.5"/><circle cx="220" cy="120" r="1.8" fill="%2300ffcc" opacity="0.7"/><circle cx="130" cy="240" r="2.2" fill="%23fff" opacity="0.4"/></svg>') repeat;
    z-index: 2;
    animation: moveSpaceshipBg 120s linear infinite;
}

@keyframes moveSpaceshipBg {
    from { background-position: 0 0; }
    to { background-position: -10000px 5000px; }
}

.satellites {
    position: absolute;
    width: 100%; height: 100%;
    z-index: 3;
    pointer-events: none;
}

.satellite {
    position: absolute;
    width: 4px; height: 4px;
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary), 0 0 20px var(--neon-yellow);
    border-radius: 50%;
}

.sat-1 { top: 20%; left: -10%; animation: orbitSat1 25s linear infinite; }
.sat-2 { top: 60%; left: -10%; animation: orbitSat2 35s linear infinite 5s; }

@keyframes orbitSat1 {
    0% { transform: translateX(0) translateY(0); opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translateX(120vw) translateY(-40vh); opacity: 0; }
}

@keyframes orbitSat2 {
    0% { transform: translateX(0) translateY(0); opacity: 0; }
    20% { opacity: 0.8; }
    80% { opacity: 0.8; }
    100% { transform: translateX(120vw) translateY(30vh); opacity: 0; }
}

/* ============================================================================
   2. NAVIGATION & MAIN CONTAINER
   ============================================================================ */
.top-nav {
    width: 100%;
    max-width: 1100px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    z-index: 10;
}

.nav-back {
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(0, 229, 255, 0.6);
    color: #fff;
    padding: 10px 22px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.nav-back:hover {
    background: var(--primary);
    color: #0f172a;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.8);
    transform: translateY(-2px);
}

.brand-badge {
    background: rgba(255, 230, 0, 0.15);
    border: 1px solid var(--neon-yellow);
    color: var(--neon-yellow);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    backdrop-filter: blur(10px);
}

.robotics-container {
    background: var(--card-bg);
    border: 2px solid rgba(0, 255, 204, 0.5);
    border-radius: 24px;
    padding: 40px 30px;
    width: 100%;
    max-width: 1100px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6), inset 0 0 30px rgba(0, 255, 204, 0.1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    text-align: center;
    z-index: 10;
    margin-bottom: 20px;
}

.coming-soon-tag {
    display: inline-block;
    background: rgba(255, 64, 129, 0.2);
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 12px;
    box-shadow: 0 0 15px rgba(255, 64, 129, 0.4);
}

.page-title {
    font-size: 2.4rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: 12px;
    text-transform: uppercase;
    text-shadow: 0 0 20px rgba(0, 255, 204, 0.5);
}

.page-title span {
    color: var(--neon-yellow);
}

.page-description {
    font-size: 1rem;
    line-height: 1.6;
    color: #cbd5e1;
    margin-bottom: 35px;
    max-width: 750px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================================================
   3. 20-ITEM INTERACTIVE GRID (ROBOTICS)
   ============================================================================ */
.insight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.insight-card {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(0, 229, 255, 0.3);
    border-radius: 14px;
    padding: 18px 15px;
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.insight-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 4px; height: 100%;
    background: var(--primary);
    opacity: 0.6;
    transition: opacity 0.3s;
}

.insight-card:hover {
    background: rgba(30, 41, 59, 0.95);
    border-color: var(--neon-green);
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 229, 255, 0.3);
}

.insight-card:hover::before {
    opacity: 1;
    background: var(--neon-green);
}

.card-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
    filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.5));
}

.card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}

.action-footer {
    margin-top: 15px;
}

.btn-request {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--neon-green), var(--primary));
    color: #0f172a;
    border: none;
    padding: 14px 28px;
    font-size: 0.95rem;
    font-weight: 800;
    border-radius: 12px;
    cursor: pointer;
    text-transform: uppercase;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(0, 255, 204, 0.4);
}

.btn-request:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 255, 204, 0.7);
}

/* ============================================================================
   4. INSIGHT MODAL STYLING & CONTROLS
   ============================================================================ */
.insight-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(5, 8, 15, 0.85);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
    padding: 20px;
}

.insight-modal {
    position: relative;
    background: #0f172a;
    border: 2px solid var(--primary);
    border-radius: 20px;
    max-width: 640px;
    width: 100%;
    padding: 35px 55px; /* Added side padding to comfortably fit inner nav buttons */
    box-shadow: 0 0 50px rgba(0, 229, 255, 0.4);
    animation: zoomInModal 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes zoomInModal {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-bg-layer {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 0;
    opacity: 0.35;
    border-radius: 18px;
}

.modal-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.modal-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.6));
}

.insight-modal h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 12px;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}

.insight-modal p {
    font-size: 1rem;
    line-height: 1.6;
    color: #e2e8f0;
    margin-bottom: 20px;
    background: rgba(15, 23, 42, 0.75);
    padding: 18px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Audio Controls Bar inside Modal */
.audio-controls-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
    background: rgba(15, 23, 42, 0.9);
    padding: 8px 16px;
    border-radius: 30px;
    border: 1px solid rgba(0, 229, 255, 0.3);
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.btn-audio-ctrl {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.2s, color 0.2s;
    display: flex; align-items: center; justify-content: center;
    width: 28px; height: 28px;
}

.btn-audio-ctrl:hover {
    color: var(--neon-green);
    transform: scale(1.1);
}

#volumeSlider {
    width: 100px;
    accent-color: var(--primary);
    cursor: pointer;
}

.modal-footer-tag {
    display: inline-block;
    background: rgba(0, 229, 255, 0.2);
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.btn-close-modal {
    position: absolute;
    top: 15px; right: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 36px; height: 36px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
    display: flex; align-items: center; justify-content: center;
}

.btn-close-modal:hover {
    background: var(--accent);
    box-shadow: 0 0 15px var(--accent);
}

/* Repositioned Modal Navigation Buttons (Fully visible inside inner edges) */
.modal-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(15, 23, 42, 0.9);
    border: 2px solid var(--primary);
    color: var(--primary);
    width: 40px; height: 40px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    z-index: 10;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.3);
}

.modal-nav-btn:hover {
    background: var(--primary);
    color: #0f172a;
    box-shadow: 0 0 25px var(--primary);
}

.modal-prev { left: 12px; }
.modal-next { right: 12px; }

/* ============================================================================
   5. 20 DISTINCT UNIQUE ANIMATED MODAL BACKGROUND CLASSES
   ============================================================================ */
.bg-microcontrollers { background: radial-gradient(circle, #002b3d 0%, #050d1a 80%); }
.bg-sensors { background: radial-gradient(circle, #003311 0%, #031005 80%); }
.bg-servos { background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%); }
.bg-iot { background: radial-gradient(circle, #1e1b4b 0%, #090d16 90%); }
.bg-welding { background: #090d16; }
.bg-ai { background: linear-gradient(135deg, #2e1065 0%, #090d16 100%); }
.bg-medical { background: radial-gradient(circle, #0369a1 0%, #0f172a 80%); }
.bg-agritech { background: linear-gradient(to bottom, #064e3b 0%, #0f172a 90%); }
.bg-coding { background: #020617; }
.bg-space { background: radial-gradient(circle at top, #7f1d1d 0%, #090d16 75%); }
.bg-silicon { background: linear-gradient(45deg, #1e293b 0%, #0f172a 100%); }
.bg-ev { background: radial-gradient(circle, #0284c7 0%, #090d16 85%); }
.bg-habitat { background: radial-gradient(circle, #581c87 0%, #090d16 85%); }
.bg-bionics { background: linear-gradient(135deg, #042f2e 0%, #090d16 100%); }
.bg-humanoids { background: radial-gradient(circle, #334155 0%, #090d16 90%); }
.bg-quantum { background: radial-gradient(circle, #78350f 0%, #090d16 85%); }
.bg-greentech { background: radial-gradient(circle, #14532d 0%, #090d16 85%); }
.bg-nanotech { background: radial-gradient(circle, #831843 0%, #090d16 85%); }
.bg-metaverse { background: linear-gradient(135deg, #312e81 0%, #090d16 100%); }
.bg-cyber { background: #022c22; }

/* ============================================================================
   6. ARDUINO HARDWARE EXPLORER SPECIFICS (COMPONENT IMAGES)
   ============================================================================ */

/* Component Image Wrapper for Grid Cards */
.component-img-wrapper {
    width: 65px;
    height: 65px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 12px;
    border: 1px solid rgba(0, 229, 255, 0.2);
    overflow: hidden;
    transition: all 0.3s ease;
}

.insight-card:hover .component-img-wrapper {
    border-color: var(--neon-green);
    box-shadow: 0 0 10px rgba(0, 255, 204, 0.4);
    background: rgba(15, 23, 42, 0.9);
}

.component-img-wrapper img {
    max-width: 85%;
    max-height: 85%;
    object-fit: contain;
    filter: drop-shadow(0 0 5px rgba(0, 229, 255, 0.3));
}

/* Component Image Wrapper for Modal Popup */
.modal-component-img {
    width: 140px;
    height: 140px;
    margin: 0 auto 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.85);
    border-radius: 16px;
    border: 2px solid var(--primary);
    overflow: hidden;
    box-shadow: 0 0 25px rgba(0, 229, 255, 0.4);
    position: relative;
    z-index: 2;
}

.modal-component-img img {
    max-width: 85%;
    max-height: 85%;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
}

/* Footer */
footer {
    text-align: center;
    padding: 15px;
    color: #94a3b8;
    font-size: 0.85rem;
    z-index: 10;
}

/* Responsive */
@media (max-width: 768px) {
    .page-title { font-size: 1.8rem; }
    .insight-grid { grid-template-columns: 1fr; }
    .robotics-container { padding: 25px 15px; }
    .insight-modal { padding: 30px 20px; }
    .modal-prev { left: 8px; }
    .modal-next { right: 8px; }
    .component-img-wrapper { width: 55px; height: 55px; }
}