﻿/* ==============================
   ⚡ EduPredict — FINAL PREMIUM UI
================================ */

/* ===== Layout Wrapper ===== */

html, body {
    margin: 0 !important;
    padding: 0 !important;
    height: 100%;
}

.layout-wrapper {
    display: block;
    height: 100vh;
    width: 100%;
    /*overflow: hidden;*/
    background: linear-gradient(145deg,#f7f9ff,#eef3ff);
}

/* ===== Sidebar ===== */



/* Logo */

.logo-section {
    font-size: 1.55rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
}

/* Navigation */

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.nav-link {
    text-decoration: none;
    color: #e6e6e6;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem .7rem;
    border-radius: 8px;
    transition: .25s;
}

    .nav-link:hover {
        background: rgba(255,255,255,.12);
        transform: translateX(4px);
    }

    .nav-link.active {
        border-left: 4px solid #4dabf7;
        background: rgba(255,255,255,.15);
        font-weight: 600;
    }

/* Sidebar footer */

.footer {
    position: absolute;
    bottom: 14px;
    width: 100%;
    text-align: center;
    font-size: .85rem;
    opacity: .8;
}

/* ===== Main Content ===== */

.main-content {
    flex: 1;
    margin-left: 240px; /* match sidebar width */
    padding: 28px 28px;
    overflow-y: auto;
    background: linear-gradient(145deg,#f9fbff,#eef3ff);
    animation: fadeInUp .4s ease;
    transition: margin-left 0.3s ease;
}
    /*   Resize fix*/
    

/* ===== Page Header ===== */

.page-header {
    background: #f7f8fb;
    padding: 14px 20px;
    border-radius: 10px;
    margin-bottom: 18px;
}

    .page-header h4 {
        margin: 0;
        font-size: 20px;
        font-weight: 600;
    }

    .page-header span {
        font-size: 13px;
        color: #6c757d;
    }

    .page-header h2 {
        font-size: 1.5rem;
        font-weight: 700;
    }

    .page-header p {
        color: #666;
    }

.page-subtitle {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 0;
}

/* ===== Cards ===== */

.card {
    background: #fff;
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: 0 10px 25px rgba(0,0,0,.08);
}

    .card:hover {
        transform: translateY(-3px);
        box-shadow: 0 14px 32px rgba(0,0,0,0.12);
    }

/* ===============================
   TABLE STYLING
================================ */

.table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 12px;
    /*overflow: hidden;*/
    /*table-layout: fixed !important;*/
    table-layout: auto !important;
}

/*td, th {
    white-space: nowrap;
}*/

.table th {
    background: #f8fafc;
    padding: 12px;
    text-align: left;
}

.table td {
    padding: 11px;
}

.table tbody tr {
    transition: background .2s ease;
}

    .table tbody tr:nth-child(even) {
        background: #f9fbff;
    }

    .table tbody tr:hover {
        background: #f2f6ff;
        transform: scale(1.002);
    }

/* ===============================
   CHART SECTION
================================ */

.chart-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.chart-card {
    background: #fff;
    border-radius: 14px;
    padding: 1.2rem 1.5rem;
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
    min-height: 120px;
}

    .chart-card canvas {
        height: 240px !important;
        max-width: 380px;
        margin: auto;
        display: block;
    }

    .chart-card .btn {
        font-size: 13px;
        padding: 6px 12px;
    }

    .chart-card ul {
        padding-left: 18px;
    }

    .chart-card li {
        margin-bottom: 6px;
    }

/* ===============================
   REPORTS PAGE
================================ */

.report-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.report-card {
    background: #fff;
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
}

/* ===============================
   LOGIN PAGE
================================ */

.login-page-wrapper {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at top,#1f3a5f,#0b1f36);
}

.login-box {
    width: 380px;
    margin: auto;
    margin-top: 120px;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    text-align: center;
}

.login-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.login-subtitle {
    color: #666;
    margin-bottom: 25px;
}

.login-input {
    width: 100%;
    padding: 12px;
    margin-bottom: 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

    .login-input:focus {
        outline: none;
        border-color: #4f6df5;
    }

.login-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 6px;
    background: #3f6ae0;
    color: white;
    font-weight: 500;
    cursor: pointer;
}

    .login-btn:disabled {
        opacity: 0.7;
        cursor: not-allowed;
    }

.login-error {
    color: #d9534f;
    margin-top: 12px;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top: 2px solid white;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===============================
   RANK BADGES
================================ */

.rank-badge {
    font-size: .75rem;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 600;
}

.rank-1 {
    background: #fde68a;
}

.rank-2 {
    background: #e5e7eb;
}

.rank-3 {
    background: #fed7aa;
}

/* ===============================
   STUDENT RISK PAGE
================================ */

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 25px;
    margin: 0;
    flex-wrap: wrap;
}

/* Risk Summary Cards */

.risk-summary {
    display: flex;
    gap: 16px;
    margin-top: 10px;
    margin-bottom: 22px;
}

.risk-card {
    flex: 1;
    height: 95px;
    border-radius: 14px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: all .2s ease;
}

    .risk-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    }

    .risk-card p {
        margin: 4px 0 0;
        font-size: 14px;
    }

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

    .risk-card.high {
        background: linear-gradient(135deg,#ef4444,#dc2626);
    }

    .risk-card.medium {
        background: linear-gradient(135deg,#f59e0b,#d97706);
    }

    .risk-card.low {
        background: linear-gradient(135deg,#22c55e,#16a34a);
    }

    .risk-card h4 {
        font-size: 28px;
        margin-bottom: 4px;
    }

    .risk-card.high h4 {
        color: white;
    }

    .risk-card.medium h4,
    .risk-card.low h4 {
        color: #1f2937;
    }

/* Filters */

.filters-bar {
    display: flex;
    gap: 20px;
    align-items: end;
    margin-bottom: 25px;
    padding: 15px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.05);
    width: fit-content;
}

.filter-box {
    display: flex;
    flex-direction: column;
    min-width: 220px;
}

    .filter-box label {
        font-size: 13px;
        font-weight: 600;
        color: #666;
        margin-bottom: 6px;
    }

.form-select {
    height: 40px;
    border-radius: 8px;
}

    .form-select:focus,
    .form-control:focus {
        border-color: #7aa7ff;
        box-shadow: 0 0 0 1px rgba(122,167,255,0.2);
    }

.search-box {
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #ddd;
    width: 260px;
    background: white;
}

    .search-box:focus {
        outline: none;
        border-color: #4f6df5;
        box-shadow: 0 0 0 2px rgba(79,109,245,.15);
    }

.risk-filter {
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: white;
}

/* Table Card */

.table-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 28px rgba(0,0,0,.08);
    margin-top: 14px;
}

/* Risk Badges */

.risk-badge {
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
}

.badge-high {
    background: #fee2e2;
    color: #b91c1c;
}

.badge-medium {
    background: #fef3c7;
    color: #92400e;
}

.badge-low {
    background: #dcfce7;
    color: #166534;
}

/* ===============================
   ANIMATIONS
================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===============================
   RESPONSIVE
================================ */

@media(max-width:992px) {

    .layout-wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: 100vh;
        
        justify-content: space-around;
        display: flex;
        flex-direction: column;
    }

    .chart-section {
        grid-template-columns: 1fr;
    }

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

/* Premium Table */

.premium-table th {
    font-weight: 600;
    letter-spacing: .3px;
}

.premium-table td {
    font-size: 14px;
}

.premium-table tbody tr:hover {
    background: #f6f8ff;
}

/* Sidebar Logout as Menu Item */

.logout-link {
    margin-top: 20px;
    cursor: pointer;
    opacity: .9;
}

    .logout-link:hover {
        background: rgba(255,255,255,.12);
        transform: translateX(4px);
    }

/* ===============================
   ROLE DISPLAY (SIDEBAR)
================================ */

.role-display {
    margin-bottom: 18px;
    font-size: 14px;
}

.role-badge {
    margin-left: 6px;
    padding: 3px 10px;
    border-radius: 12px;
    background: rgba(255,255,255,.15);
    font-size: 12px;
}

.form-card {
    max-width: 700px;
    border-radius: 12px;
}

.page-container {
    width: 100%;
    max-width: 1200px;
}

.upload-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    width: 100%;
}

.upload-btn {
    min-width: 160px;
}

    .upload-btn.upload-btn {
        padding: 12px 24px;
        font-weight: 600;
        font-size: 16px;
    }

.upload-result {
    margin-top: 20px;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
}

.result-card {
    background: white;
    padding: 16px;
    border-radius: 10px;
    text-align: center;
    /*box-shadow: 0 4px 12px rgba(0,0,0,0.08);*/
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 120px;
}

    .result-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 10px 20px rgba(0,0,0,0.08);
    }

.card-title {
    font-size: 14px;
    color: #666;
}

.card-value {
    font-size: 36px;
    font-weight: 700;
}

.result-card.success {
    border-top: 4px solid #22c55e;
}

.result-card.danger {
    border-top: 4px solid #ef4444;
}

.result-card.warning {
    border-top: 4px solid #ffc107;
    background-color: #fff3cd; /* slightly better than current */
}

.badge {
    font-size: 12px;
    padding: 6px 10px;
}

.academic-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

    .academic-filters > * {
        flex: 1 1 180px; /* min width → prevents breaking */
    }

    .academic-filters select,
    .academic-filters input {
        min-width: 200px;
    }

.subject-box {
    height: 340px;
    overflow-y: auto;
}

.assigned-box {
    min-height: 340px;
}

.subject-item {
    padding: 10px 12px;
}

    .subject-item:hover {
        background: #f5f7ff;
    }

    .subject-item:active {
        cursor: grabbing;
        background: #eef2ff;
    }

.subject-badge {
    background: #4f46e5;
    color: white;
    font-weight: 600;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.drag-hint {
    opacity: .4;
    font-size: 14px;
}

.list-group-item {
    border-radius: 8px;
    margin-bottom: 6px;
    border: 1px solid #e6eaf0;
}

.action-btn {
    width: 80px;
    text-align: center;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 0.15rem rgba(13,110,253,.25);
}

.btn-outline-warning:hover {
    background: #fff3cd;
}

.btn-outline-danger:hover {
    background: #fdeaea;
}

.btn-outline-success:hover {
    background: #e8f7ee;
}

.table td,
.table th {
    padding: 14px 18px;
}

.skeleton-number {
    height: 30px;
    width: 90px;
    border-radius: 6px;
    background: linear-gradient( 90deg, #eeeeee 25%, #dddddd 37%, #eeeeee 63% );
    background-size: 400% 100%;
    animation: skeleton-loading 1.4s ease infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0 50%;
    }
}

/* Premium Scrollbar */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,.2);
    border-radius: 10px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: rgba(0,0,0,.35);
    }

.btn {
    transition: all .2s ease;
}

    .btn:hover {
        transform: translateY(-1px);
    }

.filter-card {
    background: white;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,.06);
    margin-bottom: 20px;
    
    top: 10px;
    z-index: 10;
}

.nav-tabs .nav-link.active {
    color: #0d6efd;
    background-color: #ffffff;
    border-color: #dee2e6 #dee2e6 #ffffff;
    font-weight: 600;
}

.nav-tabs .nav-link {
    color: #6c757d;
}

select:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

/***  Add  Home work page*/

/*.main-card {
    padding: 20px;
    border-radius: 12px;
}

.subject-card {
    border: 1px solid #eee;
    border-left: 4px solid #0d6efd;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    background: #fafafa;
}

.subject-text {
    height: 60px;
}

.add-btn {
    width: 100%;
    border: 1px dashed #aaa;
    background: #f8f9fa;
}

.save-btn {
    background: #0d6efd;
    color: white;
    border-radius: 8px;
}

.invalid {
    border: 1px solid red !important;
}*/

.erp-header {
    border: 1px solid #f1f3f5;
}

.erp-steps {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.step {
    padding: 8px 16px;
    border-radius: 20px;
    background: #f1f3f5;
    font-size: 13px;
}

    .step.active {
        background: #0d6efd;
        color: white;
    }

.subject-card {
    background: #fff;
    border: 1px solid #eef1f4;
    transition: all 0.2s ease;
}

    .subject-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 10px 25px rgba(0,0,0,0.06);
    }

.sticky-bottom {
    position: sticky;
    bottom: 0;
    z-index: 1000;
}

/* prevent content hiding */
body {
    padding-bottom: 80px;
}

/*    Sidebar update*/
.sidebar {
    width: 240px;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    background: linear-gradient(160deg, #0f172a, #1e293b);
    color: white;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(20px);    
    transition: width 0.25s ease;
}

    .sidebar.collapsed {
        width: 70px;
    }
        .sidebar.collapsed ~ .main-content {
            margin-left: 70px;
        }
        .sidebar.collapsed .menu-text {
            display: none;
        }
        .sidebar.collapsed .menu-item span,
        .sidebar.collapsed .menu-section,
        .sidebar.collapsed .role-box {
            display: none;
        }

.sidebar-footer {
    padding: 10px;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
}

    .logo span {
        font-weight: 600;
        letter-spacing: 0.3px;
    }

    .logo i {
        font-weight: 600;
        font-size: 24px;
        background: linear-gradient(135deg, #60a5fa, #a78bfa);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    .logo:hover {
        transform: scale(1.03);
        transition: 0.2s ease;
    }

.toggle-btn {
    background: transparent;
    border: none;
    color: #cbd5e1;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

    .toggle-btn:hover {
        background: rgba(255,255,255,0.1);
        color: #fff;
    }

/* ICON ANIMATION */
.toggle-icon {
    transition: transform 0.2s ease;
}

.role-box {
    padding: 10px 15px;
    font-size: 12px;
    opacity: 0.8;
}

.role-badge {
    background: #2563eb;
    padding: 3px 8px;
    border-radius: 8px;
}

.menu {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
}

    /* Scrollbar width */
    .menu::-webkit-scrollbar {
        width: 0px;
    }

    .menu:hover::-webkit-scrollbar {
        width: 6px;
    }

    /* Track */
    .menu::-webkit-scrollbar-track {
        background: transparent;
    }

    /* Thumb */
    .menu::-webkit-scrollbar-thumb {
        background: rgba(255,255,255,0.2);
        border-radius: 10px;
    }

        /* Hover */
        .menu::-webkit-scrollbar-thumb:hover {
            background: rgba(255,255,255,0.4);
        }   

.menu-section {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    opacity: 0.7;
    margin-top: 20px;
}

    .menu-section::after {
        content: "";
        display: block;
        height: 1px;
        background: rgba(255,255,255,0.08);
        margin-top: 6px;
    }

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    margin-bottom: 6px;
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.2s ease;
    user-select: none;
}

    .menu-item i {
        font-size: 18px;
    }

    .menu-item:hover {
       
        color: white;
        transform: translateX(3px);
    }

    .menu-item:hover {
        background: rgba(59,130,246,0.2);
        border-radius: 12px;
    }

    .menu-item.active {
        background: linear-gradient(90deg, #2563eb, #3b82f6);
        color: white;
        box-shadow: 0 5px 20px rgba(37,99,235,0.4);
    }

.logout {
    color: #f87171;
}

.logout:hover {
    background: rgba(255,0,0,0.1);
}
/*.table td {
    white-space: normal !important;
    word-break: break-word;
}*/
.message-col {
    white-space: normal !important; /* allow wrapping */
    word-break: break-word; /* break long words */
    max-width: 350px; /* control width */
    line-height: 1.4;
}

.risk-dashboard {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    align-items: stretch;
}

.chart-panel,
.stats-panel {
    flex: 1;
    min-height: 200px; /* ⭐ makes both equal */
}


.chart-panel {
    flex: 1;
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.6);
    border: 1px solid #e5e7eb;
    position: relative;
    display: flex;
    flex-direction: column;
}    

.chart-header {
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-wrapper {
    height: 200px;
    width: 100%;
    position: relative;
    flex: 1;   
}

    /*.chart-wrapper canvas {
        width: 100% !important;
        height: 100% !important;
    }*/

.stats-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    justify-content: center;    
}

    .stats-panel .stat-card:first-child {
        margin-top: 15px; /* 🔥 moves cards down without shrinking */
    }

/*.stat-card {
    border-radius: 16px;
    padding: 20px;
    color: white;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}*/

.stat-value {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: 1px;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
}

.stat-card.high {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.stat-card.medium {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.stat-card.low {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

body {
    background: linear-gradient(135deg, #f8fafc, #eef2f7);
}
