/* GLOBAL FIX */
*{
box-sizing:border-box;
}

.mobile-menu-btn{
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    background: #2563eb;
    color: white;
    padding: 10px 12px;
    border-radius: 8px;
    z-index: 9999;
    cursor: pointer;
    font-size: 20px;
    border: none;
}

        :root {
            --primary: #2563eb;
            --primary-light: #dbeafe;
            --danger: #ef4444;
            --success: #22c55e;
            --warning: #f59e0b;
            --dark: #0f172a;
            --slate: #64748b;
            --light: rgba(255, 255, 255, 0.98);
            --sidebar-bg: rgba(15, 23, 42, 0.98);
        }

        @keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
        .reveal { animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards; }


        html {
            min-height: 100%;
            background: linear-gradient(135deg, #020617, #0f172a, #1e3a8a);
            background-color: #020617;
        }

        body { 
            font-family: 'Plus Jakarta Sans', sans-serif; 
            margin: 0; 
            display: flex; 
            background: transparent;
            overflow-x: hidden; 
            color: var(--dark); 
            min-height: 100vh;
            background-color: #020617;
        }

        html, body {
            overscroll-behavior-y: auto;
        }


             
    
        #customAlert { position: fixed; top: 20px; right: 20px; padding: 16px 28px; border-radius: 12px; color: white; font-weight: 600; z-index: 3000; display: none; backdrop-filter: blur(10px); }

        /* --- Sidebar --- */
        .sidebar { width: 280px; background: var(--sidebar-bg); height: 100vh; color: white; position: fixed; left: 0; top: 0; padding: 25px; backdrop-filter: blur(20px); z-index: 100; overflow-y: auto; }
        .sidebar h2 { color: #38bdf8; font-size: 1.5rem; font-weight: 800; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 20px; }

        .nav-link { 
            display: flex; align-items: center; color: #94a3b8; padding: 14px 16px; 
            text-decoration: none; border-radius: 12px; transition: 0.3s; 
            margin-bottom: 8px; font-weight: 500; cursor: pointer;
        }
        .nav-link:hover, .nav-link.active { background: rgba(255,255,255,0.1); color: #38bdf8; }

        /* --- Dropdown Styles (අලුතින් එකතු කළා) --- */
        .dropdown-content {
            display: none;
            background: rgba(255, 255, 255, 0.05);
            margin-left: 20px;
            border-radius: 8px;
            overflow: hidden;
        }
        .dropdown:hover .dropdown-content { display: block; }
        .dropdown-content a {
            display: block;
            color: #94a3b8;
            padding: 10px 15px;
            text-decoration: none;
            font-size: 0.85rem;
            transition: 0.3s;
        }
        .dropdown-content a:hover { color: #38bdf8; background: rgba(255,255,255,0.05); }

        /* --- Main Content & Tabs --- */
        .main-content { margin-left: 310px; padding: 50px; width: calc(100% - 380px); }
        .tab-content { display: none; }
        .tab-content.active { display: block; animation: fadeInUp 0.5s ease; }

        .content-card { background: var(--light); padding: 35px; border-radius: 24px; margin-bottom: 30px; box-shadow: 0 10px 40px rgba(0,0,0,0.05); }

        #home-tab { position: relative; }
        #home-tab header { color: white; margin-left: auto; }
        #home-tab header h1 { font-size: clamp(1.8rem, 4vw, 3rem); margin: 0; }
        #home-tab .login-card { max-width: 350px; margin-left: auto; margin-right: 0; }
        .name-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

        /* --- Forms --- */
        .form-input { width: 100%; padding: 14px; margin-bottom: 15px; border-radius: 10px; border: 1px solid #e2e8f0; font-family: inherit; box-sizing: border-box; }
        .btn-reg { width: 100%; background: var(--primary); color: white; border: none; padding: 14px; border-radius: 10px; cursor: pointer; font-weight: 700; transition: 0.3s; }
        .btn-reg:hover { background: #1d4ed8; transform: translateY(-2px); }
        
        .auth-toggle { text-align: center; margin-top: 15px; color: var(--slate); font-size: 0.9rem; }
        .auth-toggle span { color: var(--primary); cursor: pointer; font-weight: 700; text-decoration: underline; }

        /* --- Footer Info Box --- */
        .footer-info {
            margin-top: 15px;
            text-align: left;
            color: rgba(255, 255, 255, 0.8);
            font-size: 10.5px;
            line-height: 1.4;
            max-width: 500px;
            text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
        }

        /* Tablet + phone: overlay sidebar. Phone-only tweaks are in the 768 block. */
        @media (max-width: 1024px) {
            html, body {
                height: auto;
                min-height: 100%;
                overflow-x: hidden;
                overflow-y: auto;
                -webkit-overflow-scrolling: touch;
            }
            body {
                display: block;
            }
            .mobile-menu-btn {
                display: flex;
                align-items: center;
                justify-content: center;
            }
            .sidebar {
                left: -280px;
                width: 260px;
                height: 100vh;
                padding: 22px;
                z-index: 10000;
                transition: left 0.3s ease;
            }
            .sidebar.active {
                left: 0;
            }
            .main-content {
                margin-left: 0;
                width: 100%;
                padding: 64px 16px 40px;
            }
            .floating-icon {
                width: 48px;
                height: auto;
                opacity: 0.45;
            }
        }

        @media (max-width: 768px) {
            html, body {
                font-size: 14px;
            }
            .floating-icon,
            .side-floating-icon {
                display: none;
            }
            #home-tab header {
                text-align: center;
                margin: 0 0 16px;
            }
            #home-tab header h1 {
                font-size: 1.6rem;
                line-height: 1.2;
            }
            #home-tab header p {
                font-size: 0.9rem;
            }
            #home-tab .login-card {
                margin: 16px auto;
                max-width: 420px;
                width: 90%;
                padding: 18px;
            }
            .name-row {
                grid-template-columns: 1fr;
            }
            .footer-info {
                text-align: center;
                margin: 10px auto 0;
                max-width: 90%;
                font-size: 9px;
            }
            .content-card {
                padding: 20px;
            }
            .video-item {
                flex-direction: column;
                align-items: flex-start;
            }
            .video-thumb {
                width: 100%;
                height: auto;
                margin-right: 0;
                margin-bottom: 10px;
            }
            .stats-grid {
                grid-template-columns: 1fr;
            }
            .input-group {
                flex-wrap: wrap;
            }
        }

        @media (min-width: 1025px) and (max-width: 1366px) {
            .sidebar { width: 260px; padding: 20px; }
            .main-content { margin-left: 290px; width: calc(100% - 320px); }
        }
/* CSS කෑල්ල විතරයි - මේක විතරක් Replace කරන්න */

.floating-icon {
    position: absolute;
    color: transparent;
    -webkit-text-stroke: 1.8px rgba(52, 152, 219, 0.8);
    filter: drop-shadow(0 0 15px rgba(52, 152, 219, 0.5));
    display: inline-block;
    z-index: 10; /* මේ පේළිය අලුතින් එකතු කරන්න */
    pointer-events: none; /* අයිකන උඩින් තිබුණත් බටන් එබීමට බාධාවක් වෙන්නේ නැහැ */
}
/* --- අයිකන් හතරට Animations 4ක් --- */

.pos1 { 
    top: 10vh; left: 80vw; font-size: 5rem; 
    animation: moveUp 6s ease-in-out infinite; 
} 


.pos3 { 
    top: 50vh; left: 35vw; font-size: 5.5rem; 
    animation: moveSide 8s ease-in-out infinite; 
} 

.pos4 { 
    top: 25vh; left: 30vw; font-size: 5rem; 
    animation: moveDiagonal 9s ease-in-out infinite; 
}

/* --- එකිනෙකට වෙනස් ඇනිමේෂන් ටික මෙන්න --- */

@keyframes moveUp {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-40px) rotate(10deg); }
}

@keyframes moveDown {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(40px) rotate(-10deg); } /* පල්ලෙහාට */
}

@keyframes moveSide {
    0%, 100% { transform: translateX(0) scale(1); }
    50% { transform: translateX(30px) scale(1.1); } /* පැත්තට */
}

@keyframes moveDiagonal {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-20px, -20px); } /* ඇලයට */

}


.side-floating-icon {
    position: fixed;
    bottom: 30px; /* WhatsApp එකට වඩා චුට්ටක් උඩින් තියෙන්න (WhatsApp එක තියෙන්නේ bottom 40px වල නම්) */
    right: 180px;
    z-index: 99;
    animation: floatSide 3s ease-in-out infinite; /* පාවෙන animation එක */
}

.side-floating-icon img {
    width: 70px; /* අයිකනයේ ප්‍රමාණය */
    height: auto;
    filter: drop-shadow(0 0 8px rgba(52, 152, 219, 0.6));
    opacity: 0.8; /* චුට්ටක් transparent කළා පෙනුම ලස්සන වෙන්න */
}

/* පාවෙන animation එක */
@keyframes floatSide {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-15px); /* උඩට පල්ලෙහාට යන ප්‍රමාණය */
    }
}

    .whatsapp-float {
        position: fixed;
        width: 65px;
        height: 65px;
        bottom: 25px;
        right: 25px;
        background-color: #25d366;
        color: #FFF;
        border-radius: 50%;
        z-index: 1000;
        display: flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        /* මුලින් තියෙන shadow එක */
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
        animation: big-pulse 1.5s infinite; /* වේගය තත්පර 1.5 දක්වා වැඩි කළා */
        transition: 0.3s;
    }

    @keyframes big-pulse {
        0% {
            transform: scale(0.95);
            box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
        }
        70% {
            transform: scale(1);
            /* මෙතන 40px දැම්මේ Wave එක ලොකුවට විහිදෙන්න */
            box-shadow: 0 0 0 40px rgba(37, 211, 102, 0);
        }
        100% {
            transform: scale(0.95);
            box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
        }
    }

    .whatsapp-float:hover {
        background-color: #128C7E;
        transform: scale(1.1);
        animation: none; /* Hover කරද්දී Pulse එක නවතිනවා */
    }

    .whatsapp-icon {
        width: 38px;
        height: 38px;
    }

@media (max-width: 768px) {
    .floating-icon,
    .side-floating-icon {
        display: none;
    }
}
  /* Content Card Design */
    #portal-tab .content-card {
        background: #ffffff;
        padding: 25px;
        border-radius: 15px;
        box-shadow: 0 5px 20px rgba(0,0,0,0.1);
        font-family: 'Segoe UI', sans-serif;
    }

    .class-selector {
        display: flex; gap: 10px; margin-bottom: 25px;
        justify-content: center; flex-wrap: wrap;
    }

    .batch-btn {
        padding: 10px 25px; border: 2px solid #3498db;
        background: transparent; color: #3498db;
        border-radius: 30px; cursor: pointer; font-weight: bold;
        transition: 0.3s;
    }

    .batch-btn.active { background: #3498db; color: white; }

    /* Video List Layout */
    .video-list {
        display: flex;
        flex-direction: column;
        gap: 15px;
        max-width: 700px;
        margin: 0 auto;
    }

    .video-item {
        display: flex;
        align-items: center;
        background: #fdfdfd;
        padding: 12px;
        border-radius: 12px;
        text-decoration: none;
        color: #2c3e50;
        transition: 0.3s;
        border: 1px solid #eee;
    }

    .video-item:hover {
        background: #f0f7ff;
        transform: scale(1.02);
        box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    }

    .video-thumb {
        width: 130px;
        height: 75px;
        border-radius: 8px;
        object-fit: cover;
        margin-right: 15px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }

    .video-info { flex: 1; text-align: left; }

    .video-info h4 {
        margin: 0;
        font-size: 0.95rem;
        color: #2980b9;
    }

    .video-info p {
        margin: 4px 0 0;
        font-size: 0.8rem;
        color: #7f8c8d;
    }

    .play-icon-mini {
        color: #e74c3c;
        font-size: 1.2rem;
        margin-left: 10px;
    }
 #progress-tab {
        background-color: #f4f7f6; /* Transparent nathi wenna background ekak */
        padding: 25px;
        border-radius: 15px;
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    }

    .stats-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 20px;
        margin-bottom: 25px;
    }

    .stat-card {
        background: #ffffff; /* Sudu paata cards */
        padding: 20px;
        border-radius: 12px;
        border-top: 5px solid #3498db;
        box-shadow: 0 5px 15px rgba(0,0,0,0.08); /* Shadow eka nisa kapaala penawa */
        text-align: center;
        transition: transform 0.3s ease;
    }

    .stat-card:hover {
        transform: translateY(-5px);
    }

    .stat-card h3 {
        margin: 0;
        font-size: 0.9rem;
        color: #7f8c8d;
        text-transform: uppercase;
    }

    .stat-card p {
        margin: 10px 0 0;
        font-size: 1.8rem;
        font-weight: bold;
        color: #2c3e50;
    }

    /* Marks Input Section */
    .input-container {
        background: white;
        padding: 20px;
        border-radius: 12px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    }

    .input-group {
        display: flex;
        gap: 10px;
        margin-top: 15px;
    }

    input[type="number"] {
        flex: 1;
        padding: 12px;
        border: 2px solid #ecf0f1;
        border-radius: 8px;
        outline: none;
    }

    input[type="number"]:focus {
        border-color: #3498db;
    }

    .btn-update {
        padding: 10px 25px;
        background-color: #27ae60;
        color: white;
        border: none;
        border-radius: 8px;
        cursor: pointer;
        font-weight: 600;
    }

    .btn-update:hover {
        background-color: #219150;
    }

    .history-label {
        margin-top: 15px;
        font-size: 0.85rem;
        color: #95a5a6;
    }

    .progress-chart-container {
        margin-top: 20px;
        margin-bottom: 20px;
        background: #ffffff;
        border-radius: 12px;
        padding: 15px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    }

    .progress-chart-container canvas {
        width: 100% !important;
        height: 260px !important;
    }
/* Card Container (Responsive Base Style) */
.chat-container {
  width: 95%; /* Mobile සහ පොඩි Screen වලදී margin තියාගෙන පිරෙන්න */
  max-width: 1200px; /* Laptop/Desktop එකේදී උපරිම පැතිරෙන ප්‍රමාණය */
  height: 85vh; /* Screen එකේ උසින් 85% ක් ගන්නවා */
  margin: 20px auto; /* මැදට Align වීමට */
  background-color: #1e1e2e;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: system-ui, -apple-system, sans-serif;
  border: 1px solid #313244;
  box-sizing: border-box;
}

.chat-container * {
  box-sizing: border-box;
}

/* Header Section */
.chat-header {
  background: #007bff;
  color: #ffffff;
  padding: 16px 20px;
  font-weight: 600;
  font-size: 18px;
  text-align: center;
}

/* Messages Area */
.chat-messages {
  flex: 1;
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #181825;
}

/* Message Bubbles */
.message {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.5;
  word-break: break-word;
}

.message.user {
  background: #007bff;
  color: #ffffff;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

.message.bot {
  background: #313244;
  color: #cdd6f4;
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}

/* Bottom Input Area */
.chat-input {
  display: flex;
  border-top: 1px solid #313244;
  padding: 12px;
  background: #1e1e2e;
  gap: 8px;
}

.chat-input input {
  flex: 1;
  background: #313244;
  color: #cdd6f4;
  border: 1px solid #45475a;
  padding: 12px 16px;
  border-radius: 8px;
  outline: none;
  font-size: 14px;
}

.chat-input input::placeholder {
  color: #a6adc8;
}

.chat-input button {
  background: #007bff;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.chat-input button:hover {
  background: #0056b3;
}

/* Mobile Responsiveness (Screen size < 768px) */
@media (max-width: 768px) {
  .chat-container {
    width: 100%;
    height: 100vh; /* Mobile එකේදී මුළු Screen එකම උසින් ගන්නවා */
    margin: 0;
    border-radius: 0; /* Corner rounding අයින් කරලා Mobile App එකක් වගේ පෙනෙන්න */
    border: none;
  }

  .message {
    max-width: 85%; /* Mobile එකේදී text message එක තව ටිකක් පලල් කරනවා */
    font-size: 14px;
  }

  .chat-input {
    padding: 10px;
  }
}

/* Button එක disable වූ විට පෙනුම */
#send-btn:disabled {
    background-color: #555555 !important; /* අළු පැහැයක් ගැනීම */
    color: #aaaaaa;
    cursor: not-allowed; /* මූසික ලකුණ වෙනස් කිරීම */
    opacity: 0.6;
}

