/* ======================================================
   🌟 CNPI FOOD TECHNOLOGY - MAIN STYLESHEET
====================================================== */

/* --- 1. CSS VARIABLES & RESET --- */
:root {
    --primary-green: #116530;
    --primary-yellow: #F4D160;
    --gradient: linear-gradient(135deg, var(--primary-green), var(--primary-yellow));
    --text-dark: #333333;
    --text-light: #ffffff;
    --bg-light: #f8f9fa;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Hind Siliguri', 'Outfit', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    overflow-x: hidden;
    scroll-behavior: smooth;
    opacity: 0;
    transition: opacity 0.4s ease;
}

body.loaded {
    opacity: 1;
}

/* --- 2. LANGUAGE TYPOGRAPHY --- */
.bn, .bn-block { font-family: 'Hind Siliguri', sans-serif; }
.bn { display: inline; }
.bn-block { display: block; }

.en, .en-block { font-family: 'Outfit', sans-serif; font-size: 0.95em; display: none; }

.lang-en-active .bn, .lang-en-active .bn-block { display: none; }
.lang-en-active .en { display: inline; }
.lang-en-active .en-block { display: block; }

mark { background: var(--primary-yellow); color: var(--text-dark); padding: 2px 5px; border-radius: 4px; }

/* --- 3. PRELOADER --- */
#preloader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
    background-color: var(--bg-light); z-index: 9999;
    display: flex; justify-content: center; align-items: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loader { position: relative; width: 80px; height: 80px; display: flex; justify-content: center; align-items: center; }
.loader i { font-size: 2.5rem; color: var(--primary-green); animation: pulseLoader 1.5s infinite ease-in-out; }
.loader::before {
    content: ''; position: absolute; width: 100%; height: 100%; border-radius: 50%;
    border: 4px solid transparent; border-top-color: var(--primary-green); border-bottom-color: var(--primary-yellow);
    animation: spinLoader 1.5s linear infinite;
}

@keyframes spinLoader { 100% { transform: rotate(360deg); } }
@keyframes pulseLoader { 0%, 100% { transform: scale(0.8); opacity: 0.7; } 50% { transform: scale(1.1); opacity: 1; } }

/* --- 4. HEADER & NAVIGATION --- */
header {
    position: fixed; top: 0; width: 100%; background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px); box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000; transition: var(--transition);
}

.top-bar {
    background: var(--primary-green); color: var(--text-light); text-align: center;
    padding: 8px 20px; font-size: 0.9rem; font-weight: 600;
    display: flex; justify-content: center; align-items: center; gap: 8px;
}

.nav-container { max-width: 1200px; margin: 0 auto; padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; }

.logo-area { display: flex; align-items: center; gap: 15px; text-decoration: none; z-index: 1002; }
.logo-area i { font-size: 2.5rem; background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.logo-text h1 { font-size: 1.2rem; color: var(--primary-green); font-weight: 700; line-height: 1.2; }
.logo-text p { font-size: 0.8rem; color: #666; }

nav ul { display: flex; list-style: none; gap: 20px; align-items: center; }
nav ul li a { text-decoration: none; color: var(--text-dark); font-weight: 600; font-size: 1rem; position: relative; transition: var(--transition); }
nav ul li a::after { content: ''; position: absolute; width: 0; height: 2px; bottom: -5px; left: 0; background: var(--gradient); transition: var(--transition); }
nav ul li a:hover::after { width: 100%; }
nav ul li a:hover { color: var(--primary-green); }

.header-actions { display: flex; align-items: center; gap: 15px; z-index: 1002; }
.lang-toggle { background: var(--gradient); color: white; border: none; padding: 8px 15px; border-radius: 20px; cursor: pointer; font-weight: 600; transition: var(--transition); }
.lang-toggle:hover { transform: scale(1.05); box-shadow: var(--shadow); }

.menu-toggle { display: none; background: none; border: none; font-size: 1.8rem; color: var(--primary-green); cursor: pointer; }
.menu-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 999; opacity: 0; transition: 0.3s; }
.menu-overlay.active { display: block; opacity: 1; }

/* --- 5. HERO & NEWS TICKER --- */
.hero {
    height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center;
    background: linear-gradient(rgba(17, 101, 48, 0.8), rgba(244, 209, 96, 0.6)), url('https://images.unsplash.com/photo-1606859191214-25806e8e2423?auto=format&fit=crop&q=80') center/cover;
    color: var(--text-light); padding-top: 110px;
}
.hero-content { z-index: 2; animation: fadeIn 1.5s ease-out; padding: 0 20px; }
.hero h1 { font-size: 4rem; font-weight: 700; margin-bottom: 10px; text-shadow: 2px 2px 4px rgba(0,0,0,0.3); }
.hero p { font-size: 1.5rem; margin-bottom: 30px; }

.cta-btn { display: inline-block; padding: 15px 35px; font-size: 1.1rem; font-weight: 600; color: var(--primary-green); background: var(--text-light); border-radius: 30px; text-decoration: none; box-shadow: var(--shadow); transition: var(--transition); }
.cta-btn:hover { background: var(--primary-yellow); color: var(--text-dark); transform: translateY(-3px); }

.news-ticker { background: var(--primary-green); color: white; padding: 10px 0; display: flex; align-items: center; }
.ticker-title { background: var(--primary-yellow); color: var(--text-dark); padding: 10px 20px; font-weight: 700; z-index: 2; white-space: nowrap; }
.ticker-wrap { flex: 1; overflow: hidden; white-space: nowrap; }
.ticker-move { display: inline-block; animation: ticker 20s linear infinite; }
.ticker-move:hover { animation-play-state: paused; }
@keyframes ticker { 0% { transform: translateX(100%); } 100% { transform: translateX(-100%); } }

/* --- 6. MAIN LAYOUT & CARDS --- */
.container { max-width: 1200px; margin: 50px auto; padding: 0 20px; }
.section-title { text-align: center; margin-bottom: 40px; font-size: 2.5rem; color: var(--primary-green); position: relative; }
.section-title::after { content: ''; position: absolute; width: 80px; height: 4px; background: var(--gradient); bottom: -10px; left: 50%; transform: translateX(-50%); border-radius: 2px; }

.layout-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 30px; margin-bottom: 50px; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 25px; margin-bottom: 50px; }

.card { background: white; border-radius: 15px; padding: 30px; box-shadow: var(--shadow); border-top: 5px solid var(--primary-green); transition: var(--transition); }
.card:hover { transform: translateY(-5px); box-shadow: 0 15px 40px rgba(0,0,0,0.15); }

.info-box { background: white; border-radius: 15px; padding: 30px 20px; text-align: center; box-shadow: var(--shadow); position: relative; z-index: 1; transition: var(--transition); cursor: pointer; }
.info-box::before { content: ''; position: absolute; inset: 0; background: var(--gradient); z-index: -1; opacity: 0; transition: var(--transition); }
.info-box:hover::before { opacity: 1; }
.info-box:hover { color: white; transform: translateY(-10px); }
.info-box i { font-size: 3rem; color: var(--primary-green); margin-bottom: 15px; transition: var(--transition); }
.info-box:hover i { color: white; }

/* --- INFO BOX FIX --- */
.info-box {
    background: white;
    border-radius: 15px; /* এটি মেইন বক্সের কার্ভ */
    padding: 30px 20px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden; /* এটি নিশ্চিত করে যাতে ভেতরের কিছু বাইরে না যায় */
    z-index: 1;
}

.info-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient);
    z-index: -1;
    transition: var(--transition);
    opacity: 0;
    border-radius: inherit; /* ✅ এটি যোগ করুন, তাহলে মেইন বক্সের মতো এটিও কার্ভ হবে */
}

/* মাউস রাখলে যা হবে */
.info-box:hover::before {
    opacity: 1;
}

.info-box:hover {
    color: white;
    transform: translateY(-10px);
}

/* তারিখের বক্সটি গ্রেডিয়েন্ট এবং সুন্দর করার জন্য */
.notice-date {
    background: var(--gradient) !important; /* আপনার ডিফাইন করা গ্রিন-ইয়েলো গ্রেডিয়েন্ট */
    color: white !important;
    padding: 8px 12px;
    border-radius: 8px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
    min-width: 85px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* NEW ব্যাজটিকে গোল এবং সঠিক কালার দেওয়ার জন্য */
.badge.new {
    background-color: #16a34a !important; /* গাঢ় সবুজ কালার */
    color: white !important;
    padding: 4px 10px;
    border-radius: 20px; /* গোল করার জন্য */
    font-size: 0.75rem;
    font-weight: bold;
    margin-left: 10px;
    display: inline-block;
    vertical-align: middle;
}

.notice-list li {
    padding: 18px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 20px; /* তারিখ এবং টেক্সটের মাঝখানে গ্যাপ */
    transition: var(--transition);
}

.notice-list li:hover {
    padding-left: 5px; /* মাউস রাখলে হালকা সরবে */
}

.notice-text {
    font-size: 1.05rem;
    color: var(--text-dark);
    font-weight: 500;
    flex: 1;
}



/* --- 7. TEACHERS & STAFF MODULE --- */
.search-filter-box { display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 25px; }
.search-filter-box input, .search-filter-box select { padding: 10px 16px; border-radius: 30px; border: 2px solid #eee; outline: none; font-size: 0.95rem; box-shadow: var(--shadow); transition: 0.3s; }
.search-filter-box input { width: 240px; }
.search-filter-box input:focus, .search-filter-box select:focus { border-color: var(--primary-green); box-shadow: 0 0 0 3px rgba(17, 101, 48, 0.15); }

.teacher-card { background: #fff; border-radius: 16px; padding: 20px; text-align: center; transition: all 0.35s ease; cursor: pointer; overflow: hidden; box-shadow: var(--shadow); }
.teacher-card:hover { transform: translateY(-10px) scale(1.02); box-shadow: 0 25px 50px rgba(0,0,0,0.15); }
.teacher-card.active { background: linear-gradient(135deg, #f0fdf4, #ecfeff); transform: scale(1.03); }

.teacher-img { position: relative; margin-bottom: 15px; overflow: hidden; display: inline-block; border-radius: 50%; }
.teacher-img img { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; border: 4px solid var(--primary-yellow); transition: transform 0.4s ease; pointer-events: none; }
.teacher-card:hover .teacher-img img { transform: scale(1.08); }

.teacher-info h3, .teacher-card h3 { font-size: 1.1rem; color: var(--primary-green); margin-bottom: 5px; }
.designation { font-size: 0.9rem; color: #666; margin-bottom: 12px; }
.teacher-mobile { font-size: 0.9rem; margin-top: 5px; color: #555; }

.teacher-contact { display: flex; justify-content: center; gap: 12px; margin-bottom: 10px; }
.teacher-contact a { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-size: 14px; transition: 0.3s; z-index: 2; position: relative; }
.teacher-contact a[href^="tel"] { background: #28a745; }
.teacher-contact a[href^="mailto"] { background: #007bff; }
.teacher-contact a:hover { transform: scale(1.1); }

/* --- 8. STUDENT PORTAL MODULE --- */
.student-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 20px; }
.student-controls input, .student-controls select { height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid #ddd; font-size: 0.95rem; background: #fff; transition: 0.25s; }
.student-controls input:focus, .student-controls select:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); outline: none; }

.export-btn, .print-btn { height: 42px; border-radius: 10px; border: none; font-size: 0.95rem; font-weight: 600; cursor: pointer; color: white; transition: 0.3s; }
.export-btn { background: linear-gradient(135deg, #16a34a, #22c55e); }
.print-btn { background: #2563eb; height: 38px; padding: 0 15px; border-radius: 8px; }
.export-btn:hover, .print-btn:hover { transform: translateY(-2px); box-shadow: 0 5px 12px rgba(0,0,0,0.15); }

.table-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; font-weight: 600; }
.table-wrapper { overflow-x: auto; box-shadow: var(--shadow); border-radius: 10px; }
.student-table { width: 100%; border-collapse: collapse; background: #fff; }
.student-table th { background: #2563eb; color: white; padding: 12px 10px; }
.student-table td { padding: 10px; border-bottom: 1px solid #eee; text-align: center; }
.student-table tr:hover { background: #f1f5f9; }
.table-img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }

#pagination { margin-top: 20px; text-align: center; }
#pagination button { margin: 3px; padding: 8px 12px; border: none; border-radius: 5px; background: #e5e7eb; cursor: pointer; font-weight: bold; transition: 0.3s; }
#pagination button:hover { background: #cbd5e1; }
#pagination button.active { background: #2563eb; color: white; }

/* --- 9. NOTICES, LABS & SEMESTERS --- */
.notice-list li { display: flex; align-items: center; gap: 15px; padding: 15px 0; border-bottom: 1px solid #eee; }
.notice-text { flex: 1; }
.download-btn { background: var(--primary-green); color: white; padding: 6px 12px; border-radius: 6px; text-decoration: none; font-size: 0.9rem; transition: 0.3s; }
.download-btn:hover { background: #15803d; }

.lab-slider { position: relative; overflow: hidden; margin-top: 15px; border-radius: 10px; }
.slider-wrapper { overflow: hidden; width: 100%; }
.slider-track { display: flex; transition: transform 0.5s ease; }
.slider-track img { width: 100%; height: 250px; object-fit: cover; flex-shrink: 0; border-radius: 10px; }
.lab-slider button { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.6); color: white; border: none; padding: 10px 15px; cursor: pointer; border-radius: 5px; transition: 0.3s; }
.lab-slider button:hover { background: var(--primary-green); }
.lab-slider .prev { left: 10px; }
.lab-slider .next { right: 10px; }

.semester-details { margin-top: 10px; text-align: left; }
.semester-details ul { list-style: none; }
.semester-details li { display: flex; justify-content: space-between; align-items: center; padding: 10px; border-bottom: 1px solid #eee; background: #f8fafc; margin-bottom: 5px; border-radius: 5px; }

/* --- 10. FOOTER --- */
footer { background: #1a1a1a; color: white; padding: 60px 20px 20px; }
.footer-grid { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 40px; margin-bottom: 40px; }
.footer-col h3 { color: var(--primary-yellow); margin-bottom: 20px; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col a { color: #ccc; text-decoration: none; transition: var(--transition); }
.footer-col a:hover { color: var(--primary-yellow); padding-left: 5px; }
.social-links a { display: inline-block; width: 40px; height: 40px; background: rgba(255,255,255,0.1); line-height: 40px; text-align: center; border-radius: 50%; margin-right: 10px; transition: var(--transition); color: white; }
.social-links a:hover { background: var(--primary-yellow); color: var(--text-dark); transform: translateY(-3px); }
.copyright { text-align: center; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.1); color: #888; }

/* --- 11. MODAL (General) --- */
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); justify-content: center; align-items: center; backdrop-filter: blur(5px); z-index: 2000; }
.modal-content { background: white; padding: 25px; border-radius: 15px; width: 90%; max-width: 400px; transform: scale(0.8); opacity: 0; transition: all 0.3s ease; position: relative; }
.modal.show .modal-content { transform: scale(1); opacity: 1; display: block; }
.modal-close { position: absolute; right: 15px; top: 10px; font-size: 22px; cursor: pointer; color: #666; }


/* ==========================================
   🖼️ PHOTO GALLERY STYLES
========================================== */

/* গ্যালারি টাইটেল এর নিচে মার্জিন */
.section-title {
    text-align: center;
    margin: 40px 0 30px;
}

/* গ্যালারি গ্রিড লেআউট */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* অটোমেটিক কলাম সেট করবে */
    gap: 20px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* গ্যালারি আইটেম ডিজাইন */
.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    height: 200px; /* ইমেজের উচ্চতা */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* ইমেজের সেটিংস */
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* ইমেজ ফেটে যাবে না বা চ্যাপ্টা হবে না */
    display: block;
    transition: transform 0.5s ease;
}

/* হোভার ইফেক্ট (মাউস নিলে যা হবে) */
.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.gallery-item:hover img {
    transform: scale(1.1); /* ইমেজ হালকা জুম হবে */
}

/* মোবাইল ফোনের জন্য অ্যাডজাস্টমেন্ট */
@media (max-width: 600px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 10px;
        padding: 10px;
    }
    .gallery-item {
        height: 150px;
    }
}

/* ==========================================
   🖨️ STUDENT PORTAL PRINT SETUP (A4)
========================================== */
@media print {
    /* পেজ মার্জিন এবং সাইজ সেটআপ */
    @page {
        size: A4;
        margin: 15mm;
    }

    body {
        -webkit-print-color-adjust: exact !important; /* কালার এবং ব্যাকগ্রাউন্ড দেখানোর জন্য */
        print-color-adjust: exact !important;
    }

    /* প্রিন্ট করার সময় অপ্রয়োজনীয় জিনিস (যেমন সার্চ বক্স, বাটন) লুকিয়ে ফেলা */
    header, footer, .student-controls, #pagination, .top-bar {
        display: none !important;
    }

    /* প্রিন্ট লেআউট ঠিক করা */
    .container {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* প্রিন্টের জন্য স্পেশাল হেডার ইমেজ (যদি থাকে) */
    .print-header {
        display: block !important;
        text-align: center;
        margin-bottom: 20px;
    }

    .print-header img {
        width: 100%;
        max-height: 120px;
        object-fit: contain;
    }
}

/* স্ক্রিনে থাকাকালীন প্রিন্ট হেডার লুকানো থাকবে */
.print-header {
    display: none;
}


/* সেমিস্টার লিস্ট ডিজাইন */
.semester-list {
    list-style: none;
    padding: 15px;
    margin: 0;
}

.semester-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.semester-list li:last-child {
    border-bottom: none;
}

.download-btn {
    background: #116530;
    color: white;
    text-decoration: none;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12px;
    transition: 0.3s;
}

.download-btn:hover {
    background: #F4D160;
    color: #333;
}

/* অ্যাকর্ডিয়ন বডি হাইড/শো */
.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: #fff;
}

.accordion-body.active {
    max-height: 1000px; /* একটি বড় ভ্যালু দিন যাতে কন্টেন্ট দেখা যায় */
    border-top: 1px solid #ddd;
}

/* অ্যাকর্ডিয়ন বডির ভেতরের টেক্সট এবং লিস্টের কালার ঠিক করার জন্য */
.accordion-body {
    background-color: #ffffff !important; /* ব্যাকগ্রাউন্ড সাদা */
    color: #333333 !important; /* টেক্সট কালার গাঢ় ধূসর/কালো */
    overflow: hidden;
    max-height: 0;
    transition: all 0.3s ease;
}

/* যখন অ্যাকর্ডিয়ন একটিভ হবে */
.accordion-body.active {
    max-height: 1000px; 
    padding: 15px;
    border: 1px solid #ddd;
    border-top: none;
}

/* লিস্ট আইটেমের টেক্সট এবং লিঙ্কের কালার */
.semester-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.semester-list li {
    color: #333 !important; /* টেক্সট কালার নিশ্চিত করা */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.semester-list li a {
    color: #116530; /* ডাউনলোড আইকনের কালার */
    text-decoration: none;
    font-weight: bold;
}

/* হোভার করলে টেক্সট কালার যেন না হারায় */
.semester-list li:hover {
    background-color: #f9f9f9;
}

/* --- 12. RESPONSIVE DESIGN --- */
@media (max-width: 992px) {
    .layout-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 3rem; }
}

@media (max-width: 768px) {
    .hero h1 { font-size: 2.5rem; }
    .hero p { font-size: 1.1rem; }
    .menu-toggle { display: block; }
    nav { position: fixed; top: 0; right: -300px; width: 250px; height: 100vh; background: white; box-shadow: -5px 0 15px rgba(0,0,0,0.1); transition: right 0.4s ease; z-index: 1001; padding-top: 100px; }
    nav.active { right: 0; }
    nav ul { flex-direction: column; align-items: flex-start; gap: 0; }
    nav ul li { width: 100%; }
    nav ul li a { display: block; padding: 15px 25px; border-bottom: 1px solid #f0f0f0; font-size: 1.1rem; }
    nav ul li a::after { display: none; }
    nav ul li a:hover { background: #f8f9fa; padding-left: 30px; }
}

@media (max-width: 600px) {
    .search-filter-box { flex-direction: column; align-items: stretch; }
    .search-filter-box input, .search-filter-box select { width: 100%; }
    .student-controls { grid-template-columns: 1fr; }
    .teacher-card { padding: 20px 15px; }
    .teacher-img img { width: 90px; height: 90px; }
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
