:root {
    --primary: #ea4c89;
    --primary-hover: #f082ac;
    --bg-sidebar: #ffffff;
    --text-main: #1e1b4b;
    --active-bg: #fff0f7;
    --active-text: #ea4c89;
    --theme-pink: #ea7a9c;
    --theme-blue: #4f46e5;
    --map-bg: #ffffff;
    --border-radius-main: 15px;
}

body.admin-theme {
    --primary: #4f46e5;
    --primary-hover: #6366f1;
    --active-bg: #eef2ff;
    --active-text: #4f46e5;
}


* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; height: 100vh; width: 100vw; background-color: #f4f7fc; overflow: hidden; }


.hidden { display: none !important; }
.modal-overlay { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.6); 
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px); 
    z-index: 200; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
}

@keyframes popIn { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes slideUp { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }


.main-container { display: flex; height: 100%; width: 100%; }
.left-panel { width: 45%; background-color: #fcddec; display: flex; justify-content: center; align-items: center; overflow: hidden; }
.hero-image { width: 100%; height: 100%; object-fit: contain; }
.right-panel { width: 55%; background-color: #ffffff; display: flex; justify-content: center; align-items: center; }
.form-wrapper { width: 100%; max-width: 380px; padding: 20px; }

h2 { margin-bottom: 20px; color: var(--text-main); font-size: 28px; }
.input-group { margin-bottom: 15px; }
label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 14px; }
input, select, textarea { width: 100%; padding: 12px; border: 1px solid #e7e7e9; border-radius: 8px; font-size: 16px; background: #f3f3f4; font-family: 'Inter', sans-serif; }
.main-btn { width: 100%; padding: 12px; background: var(--primary); color: white; border: none; border-radius: 8px; font-size: 16px; font-weight: 600; cursor: pointer; margin-top: 10px; transition: background 0.2s; }
.main-btn:hover { background: var(--primary-hover); }
.admin-mode .main-btn { background: #0d0c22; }
.admin-link { color: #666; font-size: 13px; cursor: pointer; text-decoration: none; }
.error-msg { color: #e53e3e; font-size: 12px; margin-top: 5px; }
.otp-box { background: white; padding: 30px; border-radius: 12px; width: 320px; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
.otp-box input { text-align: center; font-size: 24px; letter-spacing: 5px; font-weight: bold; margin-bottom: 15px; }
.secondary-btn { background: none; border: none; color: #666; margin-top: 15px; cursor: pointer; text-decoration: underline; width: 100%; }
.google-btn { background: #ffffff !important; cursor: pointer; transition: background 0.2s; }
.google-btn:hover { background: #f8f9fa !important; }

.dashboard-container { display: flex; height: 100vh; width: 100vw; background: #f1f2f7; position: relative; }


.sidebar { 
    width: 250px; 
    background: #ffffff; 
    padding: 30px 20px; 
    display: flex; 
    flex-direction: column; 
    border-right: 1px solid #e0e0e0; 
    transition: all 0.3s ease; 
    z-index: 100;
    overflow: hidden;
    white-space: nowrap; 
}


.sidebar.collapsed {
    width: 0;
    padding: 30px 0;
    border: none;
}
.logo img {
    height: 40px; /* Adjust as needed */
    width: auto;
    border-radius: 5px; /* Optional: adds a soft look */
}

.brand { font-size: 20px; font-weight: 700; color: #1a202c; margin-bottom: 40px; display: flex; align-items: center; gap: 10px; padding-left: 5px; }
.brand i { color: var(--primary); }

.side-menu { list-style: none; flex: 1; }
.side-menu li { margin-bottom: 10px; }
.side-menu a { display: flex; align-items: center; gap: 15px; text-decoration: none; color: #718096; font-weight: 500; padding: 12px 15px; border-radius: 12px; transition: 0.2s; }
.side-menu li.active a { background-color: var(--active-bg); color: var(--active-text); font-weight: 600; }

.logout-link { background: none; border: none; color: #718096; cursor: pointer; font-size: 16px; display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 15px; }
.logout-wrapper { margin-top: auto; }

.main-content { flex: 1; padding: 30px; overflow-y: auto; width: 100%; transition: width 0.3s ease; }
.top-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.notification-icon { color: #a0aec0; font-size: 20px; cursor: pointer; }


.mobile-menu-btn { 
    display: block; 
    background: none; 
    border: none; 
    font-size: 22px; 
    color: #1e1b4b; 
    cursor: pointer; 
    margin-right: 15px; 
}


.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; 
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    z-index: 90; 
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    transition: opacity 0.3s;
}
.dashboard-top-row { display: flex; gap: 20px; margin-bottom: 30px; }
.welcome-banner { flex: 2; background: white; padding: 30px; border-radius: 16px; box-shadow: 0 2px 10px rgba(0,0,0,0.02); margin-bottom: 0; border-top: 5px solid var(--primary); }
.digital-id-card { flex: 1; background: white; padding: 20px; border-radius: 16px; text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,0.02); display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid #eee; }
#dash-qr-code img { width: 80px; height: 80px; margin-bottom: 5px; }
#dash-barcode { width: 100%; height: 40px; }

.profile-main { display: flex; align-items: center; gap: 20px; }
.big-profile-img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 4px solid #f8f9fc; }
.roll-badge { background: #eef2ff; color: #4f46e5; padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.dept-text { color: #718096; font-size: 14px; }

.stats-grid { display: flex; gap: 20px; margin-bottom: 30px; }
.dashboard-card { background: white; padding: 25px 20px; border-radius: 16px; flex: 1; display: flex; align-items: center; gap: 20px; transition: transform 0.2s; cursor: pointer; }
.dashboard-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.05); }
.card-icon { width: 55px; height: 55px; border-radius: 14px; display: flex; justify-content: center; align-items: center; font-size: 22px; }

.student-card { background: white; border-radius: 16px; padding: 30px; position: relative; min-height: 300px; }
.card-header { display: flex; align-items: center; gap: 20px; margin-bottom: 30px; border-bottom: 1px solid #eee; padding-bottom: 20px; }
.student-search-box { display: flex; gap: 10px; margin-bottom: 30px; background: white; padding: 10px; border-radius: 12px; }
.student-search-box input { flex: 1; border: none; background: transparent; outline: none; }
.search-btn { background: #0d0c22; color: white; padding: 10px 20px; border-radius: 8px; border: none; cursor: pointer; }

.data-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.data-table th { text-align: left; padding: 12px; color: #718096; font-size: 13px; border-bottom: 2px solid #edf2f7; }
.data-table td { padding: 15px 12px; border-bottom: 1px solid #edf2f7; font-size: 14px; color: #2d3748; }

.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 25px; }
.book-card { background: white; padding: 15px; border-radius: 15px; text-align: center; box-shadow: 0 4px 6px rgba(0,0,0,0.02); transition: transform 0.2s; }
.book-card:hover { transform: translateY(-3px); }
.book-card img { width: 100%; border-radius: 8px; margin-bottom: 10px; }
.status-tag { background: #e0e7ff; color: #4338ca; padding: 4px 8px; border-radius: 4px; font-size: 11px; font-weight: bold; }

.add-fab { position: fixed; bottom: 40px; right: 40px; background: #0d0c22; color: white; border: none; padding: 15px 25px; border-radius: 50px; font-size: 16px; font-weight: 600; cursor: pointer; z-index: 99; box-shadow: 0 4px 15px rgba(0,0,0,0.2); }


.chatbot-widget { position: fixed; bottom: 20px; right: 20px; z-index: 1000; display: flex; flex-direction: column; align-items: flex-end; }
.chat-fab { width: 60px; height: 60px; border-radius: 50%; background: var(--primary); color: white; border: none; font-size: 24px; cursor: pointer; box-shadow: 0 4px 15px rgba(0,0,0,0.2); transition: transform 0.2s; display: flex; justify-content: center; align-items: center; }
.chat-fab:hover { transform: scale(1.1); }
.chat-window { width: 350px; height: 450px; background: white; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.15); display: flex; flex-direction: column; overflow: hidden; margin-bottom: 15px; border: 1px solid #eee; }
.chat-header { background: var(--primary); color: white; padding: 15px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.chat-messages { flex: 1; padding: 15px; overflow-y: auto; background: #f9fafb; display: flex; flex-direction: column; gap: 10px; }
.chat-bubble { max-width: 80%; padding: 10px 14px; border-radius: 10px; font-size: 14px; line-height: 1.4; }
.chat-bubble.bot { background: #fff; border: 1px solid #e2e8f0; align-self: flex-start; color: #333; border-bottom-left-radius: 2px; }
.chat-bubble.user { background: var(--primary); color: white; align-self: flex-end; border-bottom-right-radius: 2px; }
.chat-input-area { padding: 10px; border-top: 1px solid #eee; display: flex; gap: 10px; background: white; }
.chat-input-area input { flex: 1; padding: 10px; border: 1px solid #e2e8f0; border-radius: 20px; outline: none; }
.chat-input-area button { background: none; border: none; color: var(--primary); font-size: 18px; cursor: pointer; }


.map-container-wrapper { width: 100%; display: block; overflow: auto; padding: 20px; background: #f8f9fc; }
.library-floor { flex-shrink: 0; position: relative; width: 800px; height: 550px; background-color: var(--map-bg); border-radius: var(--border-radius-main); box-shadow: 0 10px 25px rgba(0,0,0,0.05); font-size: 10px; border: 4px solid #eee; margin: 0 auto 20px auto; }
.seat { position: absolute; width: 34px; height: 34px; border-radius: 50%; font-size: 11px; z-index: 10; cursor: pointer; display: flex; justify-content: center; align-items: center; font-weight: bold; background-color: #ffffff; border: 2px solid #cbd5e0; color: #4a5568; transition: all 0.2s; }
.seat:hover { transform: scale(1.1); }
.seat.booked, .seat.occupied { background-color: #ef4444 !important; color: white !important; border-color: #ef4444 !important; }
.seat.reserved { background-color: #f97316 !important; color: white !important; border-color: #f97316 !important; animation: pulse 1.5s infinite; }
.seat.booked-user { background-color: #10b981 !important; color: white !important; border-color: #10b981 !important; }
.seat.selected { background-color: #db2777; border-color: #db2777; color: white; }
.map-obj { position: absolute; display: flex; justify-content: center; align-items: center; font-weight: bold; text-transform: uppercase; border-radius: 4px; font-size: 11px; z-index: 5; background: #e0e7ff; color: #4338ca; }
.booking-footer { margin-top: 15px; padding: 15px; background: white; border-radius: 12px; box-shadow: 0 -4px 20px rgba(0,0,0,0.05); display: flex; justify-content: space-between; align-items: center; border: 1px solid #eee; animation: slideUp 0.3s ease-out; }


.s-D1, .s-adm-D1 { top: 13%; left: 8%; } .s-A1, .s-adm-A1 { top: 33%; left: 25.5%; } .s-A6, .s-adm-A6 { top: 67%; left: 25.5%; } .s-A4, .s-adm-A4 { top: 42%; left: 17%; } .s-A5, .s-adm-A5 { top: 58%; left: 17%; } .s-A3, .s-adm-A3 { top: 42%; left: 34%; } .s-A2, .s-adm-A2 { top: 58%; left: 34%; } .s-B1, .s-adm-B1 { top: 48%; left: 63%; } .s-B2, .s-adm-B2 { top: 58%; left: 63%; } .s-C1, .s-adm-C1 { bottom: 18%; right: 26%; } .s-C2, .s-adm-C2 { bottom: 18%; right: 20%; } .s-C3, .s-adm-C3 { bottom: 18%; right: 14%; }
.shelf-1 { top: 4%; left: 4%; width: 25%; height: 8%; } .shelf-2 { top: 18%; left: 4%; width: 25%; height: 8%; } .counter { top: 4%; right: 4%; width: 30%; height: 12%; font-size: 14px; border-bottom-left-radius: 10px; background: var(--primary); color: white; } .shelf-3 { top: 35%; left: 4%; width: 6%; height: 35%; writing-mode: vertical-rl; transform: rotate(180deg); } .table-a { top: 40%; left: 22%; width: 10%; height: 25%; background: white; border: 2px solid #ddd; } .shelf-4 { top: 35%; left: 43%; width: 6%; height: 35%; writing-mode: vertical-rl; transform: rotate(180deg); } .table-b { top: 48%; left: 53%; width: 8%; height: 18%; writing-mode: vertical-rl; transform: rotate(180deg); background: white; border: 2px solid #ddd; } .shelf-6 { top: 35%; left: 66%; width: 6%; height: 35%; writing-mode: vertical-rl; transform: rotate(180deg); } .shelf-8 { top: 35%; right: 4%; width: 6%; height: 35%; writing-mode: vertical-rl; transform: rotate(180deg); } .shelf-5 { bottom: 4%; left: 4%; width: 35%; height: 8%; } .shelf-7 { bottom: 4%; right: 4%; width: 35%; height: 8%; } 

/* UPDATED ENTRANCE POSITION */
.entrance { 
    top: 0; 
    bottom: auto; 
    left: 0; 
    width: 100%; 
    text-align: center; 
    font-weight: 800; 
    font-size: 16px; 
    padding-top: 8px; /* Changed from padding-bottom */
    padding-bottom: 0;
    letter-spacing: 2px; 
    color: var(--primary); 
}

@media (max-width: 1100px) {
    .library-floor { transform: scale(0.85); transform-origin: top left; }
    .map-container-wrapper { height: 500px; }
}

@media (max-width: 768px) {
    .library-floor { transform: scale(0.65); transform-origin: top center; margin-bottom: -150px; }
    .map-container-wrapper { height: 400px; overflow: hidden; }

    
    .main-container { flex-direction: column; }
    .left-panel { display: none; }
    .right-panel { width: 100%; }

    
    .sidebar {
        position: fixed;
        left: -100%; 
        top: 0;
        height: 100vh;
        width: 250px;
        box-shadow: 2px 0 10px rgba(0,0,0,0.2);
    }
    .sidebar.active {
        left: 0;
        width: 250px; 
    }

    
    .sidebar.active ~ .sidebar-overlay {
        display: block;
    }

    
    .sidebar.collapsed { width: 250px; } 

    .main-content { padding: 15px; width: 100%; }
    .dashboard-top-row { flex-direction: column; }
    .stats-grid { flex-direction: column; }
    .book-grid { grid-template-columns: 1fr 1fr; }
    .top-header { justify-content: flex-start; }
    #page-title { flex: 1; font-size: 18px; }
}


.sidebar-close-btn {
    display: none;
}
/* --- MODAL & DIALOG COMPONENTS --- */
.modal-sm {
    width: 400px; 
    max-width: 90%; 
    text-align: center; 
    padding: 30px; 
    animation: popIn 0.3s ease;
}

.modal-lg {
    width: 650px; 
    max-width: 95%; 
    max-height: 90vh; 
    overflow-y: auto;
}

/* --- DIALOG SPECIFICS --- */
.dialog-icon-bg {
    width: 70px; 
    height: 70px; 
    background: #eef2ff; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    margin: 0 auto 20px auto;
}

.dialog-icon-element { font-size: 30px; color: var(--primary); }
.dialog-title { margin-bottom: 10px; color: #1e1b4b; }
.dialog-msg { color: #64748b; margin-bottom: 25px; line-height: 1.5; font-size: 15px; }

.dialog-input-box {
    border: 2px solid #e2e8f0; 
    background: #f8fafc; 
    width: 100%; 
    padding: 12px; 
    border-radius: 10px; 
    font-size: 16px; 
    outline: none; 
    text-align: center;
    margin-bottom: 25px;
}

/* --- REUSABLE UTILITIES --- */
.grid-2-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.col-span-2 { grid-column: span 2; }
.flex-center-gap { display: flex; gap: 12px; justify-content: center; }
.flex-end-gap { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.text-right-mt { text-align: right; margin-top: 10px; }

/* --- BUTTON OVERRIDES --- */
.btn-auto { width: auto; margin: 0; }
.btn-outline { border: 1px solid #cbd5e0; padding: 10px 25px; }
.btn-shadow { padding: 10px 30px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

@media (max-width: 768px) {
    .library-floor { transform: scale(0.65); transform-origin: top center; margin-bottom: -150px; }
    .map-container-wrapper { height: 400px; overflow: hidden; }

    
    .main-container { flex-direction: column; }
    .left-panel { display: none; }
    .right-panel { width: 100%; }

    
    .sidebar {
        position: fixed;
        left: -100%; 
        top: 0;
        height: 100vh;
        width: 250px;
        box-shadow: 2px 0 10px rgba(0,0,0,0.2);
        transition: left 0.3s ease; /* Smooth slide */
    }
    .sidebar.active {
        left: 0;
    }

   
    .sidebar-close-btn {
        display: block;
        position: absolute;
        top: 25px;
        right: 20px;
        background: none;
        border: none;
        color: #1e1b4b;
        font-size: 24px;
        cursor: pointer;
        z-index: 101;
    }

   
    .sidebar.active ~ .sidebar-overlay {
        display: block;
    }

    
    .sidebar.collapsed { width: 250px; }

    .main-content { padding: 15px; width: 100%; }
    .dashboard-top-row { flex-direction: column; }
    .stats-grid { flex-direction: column; }
    .book-grid { grid-template-columns: 1fr 1fr; }
    .top-header { justify-content: flex-start; }
    #page-title { flex: 1; font-size: 18px; }
}

/* --- AI Feature Styling --- */
#custom-dialog-overlay .student-card h4 {
    margin-top: 0;
    font-size: 18px;
}

#custom-dialog-overlay .student-card b {
    color: #1e1b4b;
    font-weight: 700;
}
