﻿/* =====================================================
   AI LEARNING PAGE – LIGHT THEME ONLY
   (Bootstrap Friendly)
===================================================== */

:root {
    --robot-white: #f8f9fa;
    --robot-light: #e9ecef;
    --robot-mid: #dee2e6;
    --robot-shadow: #adb5bd;
    --screen-dark: #111b27;
    --glow-blue: #64f3ff;
    --primary-blue: #3b82f6;
    --secondary-blue: #60a5fa;
    --accent-blue: #1e40af;
    --bg-dark: #0f172a;
    --bg-darker: #0a0f1c;
    --bg-card: #1e293b;
    --text-light: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
}


/* =====================================================
   MAIN LAYOUT (FIX NAVBAR OVERLAP)
===================================================== */

.main-container {
    display: flex;
    min-height: calc(100vh - 90px);
    margin-top: 90px;
    background: linear-gradient(135deg, #ffffff, #f1f5f9);
    color: var(--text-main);
}

/* =====================================================
   LEFT COLUMN – ROBOT
===================================================== */

.robot-column {
    width: 40%;
    min-width: 350px;
    padding: 60px;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-right: 1px solid var(--border-light);
 
}

/* =====================================================
   EXACT AI ROBOT (MATCHING PROVIDED IMAGE)
===================================================== */

.robot-wrapper {
    position: relative;
    z-index: 2;
}

    /* FIXED CIRCULAR BACKGROUND */
    .robot-wrapper::before {
        content: "";
        position: absolute;
        width: 380px; /* ⬅ reduced size */
        height: 380px;
        border-radius: 50%;
        background: radial-gradient( circle at top, #3b82f6 0%, #1e3a8a 55%, #0b1220 100% );
        top: 45%; /* ⬅ moved UP */
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: -1;
        box-shadow: 0 0 30px rgba(59,130,246,0.45), 0 0 60px rgba(59,130,246,0.25);
    }


/* ================= HEAD ================= */
.head {
    width: 200px;
    height: 145px;
    background: var(--screen-dark);
    border-radius: 65px 65px 50px 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 30px 60px rgba(0,0,0,.35), inset 0 3px 0 rgba(255,255,255,.95);
}

    .head::before {
        content: '';
        position: absolute;
        top: -10px;
        left: 50%;
        transform: translateX(-50%);
        width: 110px;
        height: 40px;
        background: linear-gradient(to bottom, var(--robot-white), var(--robot-light));
        border-radius: 50% 50% 0 0;
        z-index: -1;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    }

/* EARS */
.ear {
    width: 36px;
    height: 85px;
    background: linear-gradient(145deg, #ffffff, #e6eaee);
    position: absolute;
    top: 45px;
    border-radius: 22px;
    box-shadow: 0 18px 35px rgba(0,0,0,.35);
}

    .ear.left {
        left: -26px;
    }

    .ear.right {
        right: -26px;
    }

/* ================= FACE SCREEN ================= */

.face-screen {
    width: 165px;
    height: 110px;
    background: var(--screen-dark);
    border-radius: 45px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8), 0 0 15px rgba(100, 243, 255, 0.2);
}

/* EYES */
.eyes {
    display: flex;
    gap: 35px;
    margin-bottom: 8px;
    transition: transform 0.2s;
}

.eye {
    width: 30px;
    height: 16px;
    background: var(--glow-blue);
    border-radius: 20px;
    box-shadow: 0 0 12px var(--glow-blue), 0 0 25px rgba(100, 243, 255, 0.5), 0 0 35px rgba(100, 243, 255, 0.3);
    animation: blink 5s infinite;
}

/* MOUTH */
.mouth {
    width: 22px;
    height: 6px;
    background: var(--glow-blue);
    border-radius: 8px;
    margin-top: 10px;
    box-shadow: 0 0 10px var(--glow-blue), 0 0 20px rgba(100, 243, 255, 0.3);
}

/* TALKING */
.talking-mouth {
    animation: talk 0.18s infinite alternate;
}

/* ================= BODY ================= */

.torso-container {
    position: relative;
    margin-top: 10px;
    display: flex;
    justify-content: center;
}

.body-torso {
    width: 165px;
    height: 195px;
    background: linear-gradient(to bottom, var(--robot-white), var(--robot-mid));
    border-radius: 80px 80px 120px 120px;
    box-shadow: 0 45px 80px rgba(0,0,0,.45), inset 0 3px 0 rgba(255,255,255,.95);
}
/* ================= ARMS ================= */

.arm {
    width: 38px;
    height: 125px;
    background: linear-gradient(to bottom, var(--robot-white), var(--robot-mid));
    border-radius: 25px;
    position: absolute;
    top: 25px;
    z-index: -1;
    transition: 0.5s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

    .arm.left {
        left: -32px;
        transform: rotate(12deg);
    }

    .arm.right {
        right: -32px;
        transform: rotate(-12deg);
    }

/* ================= ANIMATIONS ================= */

@keyframes robotFloat {
    0%,100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

@keyframes talk {
    from {
        height: 5px;
    }

    to {
        height: 14px;
    }
}

@keyframes blink {
    0%, 94%, 100% {
        transform: scaleY(1);
    }

    96% {
        transform: scaleY(0.1);
    }
}

/* ================= MOBILE ================= */

@media (max-width: 768px) {
    .robot-wrapper {
        transform: scale(0.85);
    }
}

/* =====================================================
   CHAT INPUT – LIVE CHAT INTERFACE (EXACT STYLE)
===================================================== */

.chat-input-section {
    position: relative;
    margin-top: 25px;
    padding: 22px;
    border-radius: 18px;
    background: linear-gradient(180deg, #0f172a, #020617);
    border: 2px solid #3b82f6;
    box-shadow: 0 0 0 1px rgba(59,130,246,.3), 0 20px 50px rgba(0,0,0,.6);
}

    /* LIVE CHAT LABEL */
    .chat-input-section::before {
        content: "💬 LIVE CHAT INTERFACE";
        position: absolute;
        top: -14px;
        left: 18px;
        padding: 6px 14px;
        font-size: 12px;
        font-weight: 600;
        color: #ffffff;
        background: linear-gradient(135deg, #3b82f6, #2563eb);
        border-radius: 999px;
        box-shadow: 0 6px 18px rgba(59,130,246,.5);
    }

/* INPUT ROW */
.input-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

/* TEXT INPUT */
#chat-input {
    flex: 1;
    height: 48px;
    padding: 0 18px;
    border-radius: 14px;
    background: #020617;
    border: 1px solid rgba(255,255,255,.12);
    color: #e5e7eb;
    font-size: 14px;
    outline: none;
}

    #chat-input::placeholder {
        color: #94a3b8;
    }

/* MIC & SEND BUTTONS */
.btn-microphone,
.btn-send-chat {
    height: 48px;
    padding: 0 22px;
    border-radius: 14px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    color: #ffffff;
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    box-shadow: 0 8px 20px rgba(59,130,246,.45);
    transition: all .25s ease;
}

/* MIC ICON CENTER */
.btn-microphone {
    width: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    /* HOVER EFFECT */
    .btn-microphone:hover,
    .btn-send-chat:hover {
        transform: translateY(-2px);
        box-shadow: 0 14px 28px rgba(59,130,246,.6);
    }

    /* MIC ACTIVE */
    .btn-microphone.active {
        background: linear-gradient(135deg, #ef4444, #dc2626);
        box-shadow: 0 0 0 4px rgba(239,68,68,.35);
    }

/* VOICE STATUS BAR */
.voice-status {
    padding: 12px;
    text-align: center;
    font-size: 14px;
    color: #67e8f9;
    border-radius: 14px;
    background: rgba(59,130,246,.12);
    border: 1px solid rgba(59,130,246,.35);
}




/* =====================================================
   COMMON MESSAGE
===================================================== */

.message {
    position: relative;
    padding: 18px 20px;
    border-radius: 16px;
    margin-bottom: 16px;
    max-width: 92%;
    animation: fadeUp .3s ease;
    color: #ffffff; /* 🔥 THIS IS THE KEY FIX */
}

/* =====================================================
   ROBOT MESSAGE (AI TEACHER)
===================================================== */
.chat-container {
    background: #FFFFFF !important;
}
.robot-message {
    background: #FFFFFF;
    color: #000000;
    border-left: 4px solid #3b82f6;
    box-shadow: 0 10px 30px rgba(59,130,246,.12);
}

    /* HEADER */
    .robot-message .message-header {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 14px;
        margin-bottom: 6px;
        color: #93c5fd;
    }

    /* TEXT */
    .robot-message .message-content {
        font-size: 15px;
        line-height: 1.6;
    }

/* =====================================================
   USER MESSAGE
===================================================== */

.user-message {
    margin-left: auto;
    background: linear-gradient(135deg, #2563eb, #1e40af);
    color: #ffffff;
    border-right: 4px solid #93c5fd;
    box-shadow: 0 10px 25px rgba(37,99,235,.3);
}

    .user-message .message-header {
        font-size: 13px;
        opacity: .9;
        margin-bottom: 6px;
    }

/* =====================================================
   CODE BLOCK INSIDE CHAT
===================================================== */

.code-block {
    background: #020617;
    color: #e5e7eb;
    padding: 14px;
    border-radius: 12px;
    font-family: Consolas, monospace;
    font-size: 14px;
    margin-top: 10px;
    border: 1px solid rgba(255,255,255,.08);
    overflow-x: auto;
}

/* =====================================================
   ANIMATION
===================================================== */

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}




/* =====================================================
   RIGHT COLUMN – LEARNING
===================================================== */

.learning-column {
    width: 60%;
    padding: 30px;
    background: var(--bg-main);
    display: flex;
    flex-direction: column;
}

.learning-header {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 30px;
}

    .learning-header h1 {
        font-size: 28px;
        background: linear-gradient(90deg, var(--primary-blue), var(--glow-blue));
        -webkit-background-clip: text;
        color: transparent;
    }

.logo {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    border: 2px solid var(--primary-blue);
}

/* =====================================================
   TOPICS GRID – BLACK BORDER
===================================================== */

.topics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* FORCE 4 COLUMNS */
    gap: 15px;
    max-width: 900px; /* wider so all fit nicely */
    margin: 0 auto 15px;
}



.topic-btn {
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    background: #ffffff;
    border: 2px solid #000000; /* ✅ BLACK BORDER */
    color: var(--text-main);
    transition: 0.3s ease;
}

    .topic-btn:hover,
    .topic-btn.active {
        background: linear-gradient( 135deg, hsl(237 47% 34%), hsl(237 47% 24%) );
        color: #ffffff;
    }

.btn-header {
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    border: 2px solid #000000; /* ✅ BLACK BORDER */

    transition: 0.3s ease;
}

    .btn-header:hover,
    .btn-header.active {
        background: linear-gradient(135deg, hsl(45 96% 48%) 0%, hsl(45 96% 58%) 100%);
        color: #ffffff;
    }
/* =====================================================
   CHAT AREA
===================================================== */
/* ================= CHAT CONTAINER ================= */

/* ================= CHAT CONTAINER (FINAL FIXED) ================= */
.chat-container {
    flex-grow: 1;
    min-height: 420px;
    max-height: 420px;
    padding: 20px;
    background: linear-gradient(180deg, #0f172a, #020617);
    border-radius: 16px;
    overflow-y: auto;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
}


    /* ================= SCROLLBAR (CHAT ONLY) ================= */

    .chat-container::-webkit-scrollbar {
        width: 8px;
    }

    .chat-container::-webkit-scrollbar-track {
        background: #f1f5f9;
        border-radius: 10px;
    }

    .chat-container::-webkit-scrollbar-thumb {
        background: #3b82f6;
        border-radius: 10px;
    }

        .chat-container::-webkit-scrollbar-thumb:hover {
            background: #1e40af;
        }

/* Firefox */
.chat-container {
    scrollbar-width: thin;
    scrollbar-color: #3b82f6 #f1f5f9;
}

/* =====================================================
   ANIMATION
===================================================== */

@keyframes float {
    0%,100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-18px);
    }
}

/* =====================================================
   RESPONSIVE (BOOTSTRAP SAFE)
===================================================== */

@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
        margin-top: 80px;
    }

    .robot-column,
    .learning-column {
        width: 100%;
    }
}

/* =====================================================
   TABLET RESPONSIVE FIX (768px – 991px)
===================================================== */
@media (max-width: 991px) {

    .main-container {
        flex-direction: column;
        margin-top: 80px;
    }

    /* Robot section */
    .robot-column {
        width: 100%;
        min-width: unset;
        padding: 20px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .robot-wrapper {
        transform: scale(0.9);
    }

    /* Learning section */
    .learning-column {
        width: 100%;
        padding: 20px;
    }

    /* Topics grid → 2 columns */
    .topics-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 100%;
    }

    /* Chat height flexible */
    .chat-container {
        min-height: 360px;
        max-height: 360px;
    }
}
/* =====================================================
   MOBILE RESPONSIVE FIX (≤ 575px)
===================================================== */
@media (max-width: 575px) {

    .main-container {
        margin-top: 70px;
    }

    /* Robot scaling */
    .robot-wrapper {
        transform: scale(0.78);
    }

    /* Head & body shrink */
    .head {
        width: 170px;
        height: 125px;
    }

    .face-screen {
        width: 140px;
        height: 95px;
    }

    .body-torso {
        width: 140px;
        height: 170px;
    }

    /* Topics grid → 1 column */
    .topics-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* Chat container auto height */
    .chat-container {
        min-height: 300px;
        max-height: 300px;
        padding: 16px;
    }

    /* Chat input spacing */
    .chat-input-section {
        padding: 18px;
    }

    /* Buttons shrink */
    .btn-send-chat,
    .btn-microphone {
        height: 44px;
        padding: 0 16px;
        font-size: 14px;
    }
}
/* =====================================================
   SMALL MOBILE FIX (320px – 400px)
   SAME LAYOUT – ONLY SIZE & SPACING TUNED
===================================================== */
@media (max-width: 400px) {

    /* -------- ROBOT -------- */
    .robot-wrapper {
        transform: scale(0.7); /* ⬅ balanced (was too small / too tall) */
        margin-top: 6px;
        margin-bottom: -10px; /* ⬅ pulls chat upward */
    }

    .robot-column {
        padding: 6px 10px 0;
    }

    /* -------- CHAT INPUT -------- */
    .chat-input-section {
        padding: 10px;
        border-radius: 14px;
        margin-top: -8px; /* ⬅ fixes vertical overflow */
    }

    .input-container {
        display: flex;
        flex-direction: row; /* KEEP DESKTOP ROW */
        gap: 6px;
    }

    #chat-input {
        height: 38px;
        font-size: 13px;
        padding: 0 12px;
    }

    .btn-microphone {
        width: 42px;
        height: 38px;
        font-size: 14px;
    }

    .btn-send-chat {
        height: 38px;
        padding: 0 12px;
        font-size: 13px;
    }

    /* -------- VOICE STATUS -------- */
    .voice-status {
        font-size: 12px;
        padding: 8px;
        margin-top: 6px;
    }

    /* -------- CHAT CONTAINER -------- */
    .chat-container {
        min-height: 210px;
        max-height: 210px;
        padding: 12px;
    }

    /* -------- BOTTOM BUTTONS -------- */
    .topics-grid {
        grid-template-columns: 1fr;
        gap: 8px;
        margin-top: 8px;
    }

    .topic-btn,
    .btn-header {
        padding: 10px;
        font-size: 13px;
    }
    /* =====================================================
   TOPIC BUTTONS – MOBILE 2 PER ROW
===================================================== */
    @media (max-width: 575px) {

        .topics-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr); /* ✅ 2 per row */
            gap: 12px;
            max-width: 100%;
            margin: 0 auto;
            padding:5px;
        }

        .topic-btn {
            padding: 12px;
            font-size: 14px;
            text-align: center;
        }
    }

    /* -------- GLOBAL -------- */
    body {
        overflow-x: hidden;
    }
}

/* =====================================================
   VIRTUAL ASSISTANT – CAMERA PANEL (LIGHT THEME MATCH)
===================================================== */
#virtual-assistant-panel {
    display: none;
}

.learning-column.virtual-mode #ai-assistant-panel {
    display: none !important;
}

.learning-column.virtual-mode #virtual-assistant-panel {
    display: block !important;
}

.camera-panel {
    width: 100%;
    display: flex;
    justify-content: center;
    padding-top: 20px;
}

.camera-container {
    width: 100%;
    max-width: 700px;
    background: #ffffff;
    border-radius: 20px;
    padding: 20px;
    border: 2px solid #000000;
    box-shadow: 0 25px 60px rgba(0,0,0,0.15);
}

/* ================= CAMERA FEED ================= */

.camera-feed {
    position: relative;
    width: 100%;
    height: 350px;
    background: linear-gradient(180deg, #0f172a, #020617);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: inset 0 0 0 2px rgba(255,255,255,.05);
}

    .camera-feed video {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 16px;
    }

/* Placeholder before camera starts */
.camera-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #e5e7eb;
    font-size: 16px;
    gap: 8px;
    background: linear-gradient(180deg, #0f172a, #020617);
}

    .camera-placeholder i {
        font-size: 42px;
    }

    .camera-placeholder small {
        font-size: 13px;
        color: #94a3b8;
    }

/* ================= CAMERA CONTROLS ================= */

.camera-controls {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    justify-content: space-between;
}

.camera-btn {
    flex: 1;
    height: 48px;
    border-radius: 14px;
    border: 2px solid #000000;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(59,130,246,.35);
    transition: all 0.25s ease;
}

    .camera-btn:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: 0 14px 28px rgba(59,130,246,.5);
    }

    .camera-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

    /* Capture button */
    .camera-btn.capture {
        background: linear-gradient(135deg, #22c55e, #16a34a);
        box-shadow: 0 8px 20px rgba(34,197,94,.35);
    }

    /* Stop button */
    .camera-btn.stop {
        background: linear-gradient(135deg, #ef4444, #dc2626);
        box-shadow: 0 8px 20px rgba(239,68,68,.35);
    }

/* ================= CAMERA STATUS ================= */

.camera-status {
    margin-top: 14px;
    padding: 12px;
    text-align: center;
    font-size: 14px;
    color: #1e40af;
    background: #eff6ff;
    border-radius: 14px;
    border: 1px solid #93c5fd;
    font-weight: 600;
}
