/* ==========================================================================
   CPI Feni — Public Site Styles
   ========================================================================== */

:root {
    --cpi-primary: #0d6e3d;
    --cpi-primary-dark: #084d2a;
    --cpi-secondary: #f59e0b;
    --cpi-accent: #1e40af;
    --cpi-light: #f8fafc;
    --cpi-dark: #1e293b;
    --cpi-text: #334155;
    --cpi-muted: #64748b;
    --cpi-success: #10b981;
}

html[lang="bn"] body {
    font-family: 'Hind Siliguri', 'Noto Sans Bengali', system-ui, sans-serif;
}

html[lang="en"] body {
    font-family: 'Inter', system-ui, sans-serif;
}

body.public-site {
    color: var(--cpi-text);
    background-color: #fff;
    line-height: 1.65;
    margin-bottom: 0;
}

a {
    color: var(--cpi-primary);
    text-decoration: none;
    transition: color .2s;
}
a:hover { color: var(--cpi-primary-dark); }

.bg-primary { background-color: var(--cpi-primary) !important; }
.btn-primary {
    background-color: var(--cpi-primary);
    border-color: var(--cpi-primary);
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--cpi-primary-dark);
    border-color: var(--cpi-primary-dark);
}
.text-primary { color: var(--cpi-primary) !important; }

/* ===== Top bar ===== */
.top-bar { font-size: .85rem; }
.top-bar a:hover { color: #fef3c7 !important; }

/* ===== Header ===== */
.site-header .navbar-brand small { font-size: .75rem; line-height: 1.1; }
.site-header .nav-link {
    font-weight: 500;
    color: var(--cpi-dark) !important;
    padding: .6rem 1rem !important;
    position: relative;
}
.site-header .nav-link:hover { color: var(--cpi-primary) !important; }
.site-header .nav-link.active { color: var(--cpi-primary) !important; }
.site-header .dropdown-item:hover { background-color: rgba(13,110,61,0.08); color: var(--cpi-primary); }

/* ===== Hero ===== */
.hero-section {
    background: linear-gradient(135deg, rgba(13,110,61,.92), rgba(30,64,175,.85));
    color: white;
    padding: 6rem 0 5rem;
    position: relative;
    overflow: hidden;
}
.hero-section h1 { font-weight: 700; line-height: 1.2; }

/* ===== Stats counter ===== */
.stat-card {
    text-align: center;
    padding: 1.5rem 1rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
    transition: transform .25s;
}
.stat-card:hover { transform: translateY(-4px); }
.stat-card .stat-number {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--cpi-primary);
    line-height: 1;
}
.stat-card .stat-label { color: var(--cpi-muted); font-weight: 500; }

/* ===== Department cards ===== */
.dept-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.05);
    transition: all .3s;
    border: 1px solid #f1f5f9;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.dept-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(13,110,61,0.15);
    border-color: rgba(13,110,61,0.3);
}
.dept-card .dept-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(13,110,61,.1), rgba(30,64,175,.1));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: var(--cpi-primary);
    font-size: 1.5rem;
}
.dept-card h5 { font-weight: 600; margin-bottom: .5rem; }
.dept-card p { color: var(--cpi-muted); flex-grow: 1; font-size: .92rem; }

/* ===== Notice list ===== */
.notice-card {
    background: white;
    border-left: 4px solid var(--cpi-primary);
    padding: 1rem 1.2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    margin-bottom: .8rem;
    transition: all .2s;
}
.notice-card:hover { transform: translateX(4px); box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.notice-card.pinned { border-left-color: var(--cpi-secondary); background: #fffaeb; }
.notice-card .notice-date { font-size: .8rem; color: var(--cpi-muted); }
.notice-card .notice-title { font-weight: 600; color: var(--cpi-dark); margin: .3rem 0; }

/* ===== Section ===== */
.section { padding: 4rem 0; }
.section-title { text-align: center; margin-bottom: 3rem; }
.section-title h2 {
    font-weight: 700;
    color: var(--cpi-dark);
    position: relative;
    display: inline-block;
    padding-bottom: .8rem;
}
.section-title h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--cpi-primary);
    border-radius: 2px;
}
.section-title p { color: var(--cpi-muted); max-width: 600px; margin: .8rem auto 0; }

/* ===== Notice ticker ===== */
.notice-ticker {
    background: #fffaeb;
    border-top: 1px solid #fde68a;
    border-bottom: 1px solid #fde68a;
    padding: .7rem 0;
    overflow: hidden;
    display: flex;
    align-items: center;
}
.notice-ticker .ticker-label {
    background: var(--cpi-secondary);
    color: white;
    padding: .35rem 1rem;
    border-radius: 4px;
    font-weight: 600;
    margin-right: 1rem;
    flex-shrink: 0;
    font-size: .9rem;
}
.notice-ticker .ticker-content {
    overflow: hidden;
    white-space: nowrap;
    flex-grow: 1;
}
.notice-ticker .ticker-content span {
    display: inline-block;
    padding-left: 100%;
    animation: ticker 30s linear infinite;
}
@keyframes ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* ===== Footer ===== */
.site-footer h5, .site-footer h6 { font-weight: 600; }
.site-footer .social-links a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}
.site-footer .social-links a:hover { background: var(--cpi-primary); }
.site-footer a { transition: color .2s; }
.site-footer a:hover { color: #fff !important; }

/* ===== Login Page ===== */
.auth-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--cpi-primary), var(--cpi-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.auth-card {
    max-width: 440px;
    width: 100%;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    overflow: hidden;
}
.auth-card .auth-header {
    background: linear-gradient(135deg, var(--cpi-primary), var(--cpi-primary-dark));
    color: white;
    padding: 2rem;
    text-align: center;
}
.auth-card .auth-body { padding: 2rem; }
.auth-card .form-control {
    height: 48px;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    padding-left: 1rem;
}
.auth-card .form-control:focus {
    border-color: var(--cpi-primary);
    box-shadow: 0 0 0 .2rem rgba(13,110,61,.15);
}
.auth-card .btn-primary {
    height: 48px;
    border-radius: 10px;
    font-weight: 600;
}

/* ===== Admin Layout ===== */
body.admin-site {
    background: #f1f5f9;
    margin-bottom: 0;
}
.admin-sidebar {
    width: 260px;
    height: 100vh;
    background: linear-gradient(180deg, var(--cpi-dark), #0f172a);
    color: #cbd5e1;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    overflow-y: auto;
}
.admin-sidebar .brand {
    padding: 1.2rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    color: white;
    font-weight: 700;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
}
.admin-sidebar .brand i { color: var(--cpi-secondary); margin-right: .6rem; }
.admin-sidebar .nav-section {
    padding: 1rem 1rem .3rem;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    font-weight: 600;
}
.admin-sidebar .nav-link {
    color: #cbd5e1 !important;
    padding: .65rem 1.2rem;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
    transition: all .15s;
    font-size: .92rem;
}
.admin-sidebar .nav-link i {
    width: 22px;
    text-align: center;
    margin-right: .6rem;
    color: #94a3b8;
}
.admin-sidebar .nav-link:hover {
    background: rgba(255,255,255,0.05);
    color: white !important;
    border-left-color: var(--cpi-secondary);
}
.admin-sidebar .nav-link.active {
    background: rgba(13,110,61,0.2);
    color: white !important;
    border-left-color: var(--cpi-primary);
}
.admin-sidebar .nav-link.active i { color: var(--cpi-secondary); }

.admin-content { margin-left: 260px; min-height: 100vh; }
.admin-topbar {
    background: white;
    height: 64px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 50;
}
.admin-main { padding: 1.5rem; }

@media (max-width: 991px) {
    .admin-sidebar { transform: translateX(-100%); transition: transform .25s; }
    .admin-sidebar.show { transform: translateX(0); }
    .admin-content { margin-left: 0; }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .hero-section { padding: 3rem 0 2.5rem; }
    .hero-section h1 { font-size: 2rem; }
    .section { padding: 2.5rem 0; }
    .stat-card .stat-number { font-size: 1.8rem; }
}
