:root {
    --white: #ffffff;
    --light-grey: #f8fafc;
    --light-blue-100: #f0f9ff;
    --light-blue-200: #e0f2fe;
    --light-blue-300: #bae6fd;
    --sky-blue-light: #38bdf8;
    --sky-blue: #0ea5e9;
    --sky-blue-dark: #0284c7;
    --text-slate: #475569;
    --dark-grey: #212529;
    --text-muted: #6c757d;
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-soft: 0 4px 20px rgba(14, 165, 233, 0.05);
    --shadow-corporate: 0 8px 25px rgba(2, 132, 199, 0.12);
    --shadow-card-hover: 0 20px 35px rgba(14, 165, 233, 0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Nunito', sans-serif; background-color: var(--light-grey); color: var(--text-slate); line-height: 1.6; display: flex; flex-direction: column; min-height: 100vh; overflow-x: hidden; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
main { flex: 1; }
.section { padding: 40px 0; }
.text-center { text-align: center; }
a { text-decoration: none; }

/* NAVBAR & SIDEBAR */
.main-header { position: sticky; top: 0; left: 0; width: 100%; background-color: rgba(255, 255, 255, 0.96); backdrop-filter: blur(10px); box-shadow: var(--shadow-soft); z-index: 1000; }
.navbar { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; }
.nav-logo { display: flex; align-items: center; gap: 12px; }
.logo-img { height: 46px; width: auto; }
.logo-text { font-size: 1.35rem; font-weight: 800; color: var(--sky-blue-dark); }
.nav-links { display: flex; list-style: none; gap: 6px; }
.nav-item { color: var(--sky-blue-dark); font-weight: 700; padding: 10px 22px; border-radius: 30px; transition: var(--transition-smooth); }
.nav-item:hover, .nav-item.active { color: var(--white); background: linear-gradient(135deg, var(--sky-blue) 0%, var(--sky-blue-light) 100%); }

.hamburger-menu { display: flex; flex-direction: column; justify-content: space-between; width: 26px; height: 18px; background: transparent; border: none; cursor: pointer; z-index: 1010; }
.hamburger-menu span { width: 100%; height: 3px; background-color: var(--sky-blue-dark); border-radius: 2px; transition: var(--transition-smooth); }
.hamburger-menu.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.hamburger-menu.open span:nth-child(2) { opacity: 0; }
.hamburger-menu.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

.sidebar { position: fixed; top: 0; right: -310px; width: 310px; height: 100%; background-color: var(--white); box-shadow: -10px 0 35px rgba(14, 165, 233, 0.08); transition: var(--transition-smooth); padding: 40px 30px; display: flex; flex-direction: column; z-index: 1005; }
.sidebar.active { right: 0; }
.sidebar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 35px; padding-bottom: 15px; border-bottom: 2px solid var(--light-blue-100); }
.sidebar-title { font-size: 1.35rem; font-weight: 800; color: var(--sky-blue-dark); }
.close-sidebar-btn { background: transparent; border: none; font-size: 2.2rem; color: var(--sky-blue); cursor: pointer; line-height: 1; }
.sidebar-links { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.sidebar-links a { color: var(--sky-blue-dark); font-weight: 700; font-size: 1.1rem; padding: 12px 18px; border-radius: 14px; display: flex; align-items: center; gap: 14px; transition: var(--transition-smooth); }
.sidebar-links a:hover, .sidebar-links .active-link { background-color: var(--light-blue-100); color: var(--sky-blue); padding-left: 24px; }
.sidebar-dropdown .dropdown-menu { list-style: none; padding-left: 20px; max-height: 0; overflow: hidden; opacity: 0; transition: all 0.35s ease-in-out; display: flex; flex-direction: column; gap: 6px; }
.sidebar-dropdown.open .dropdown-menu { max-height: 200px; opacity: 1; margin-top: 5px; }
.sidebar-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background-color: rgba(2, 44, 80, 0.4); backdrop-filter: blur(4px); opacity: 0; visibility: hidden; transition: var(--transition-smooth); z-index: 1002; }
.sidebar-overlay.active { opacity: 1; visibility: visible; }

.mobile-only-link {
    display: none;
}

.page-hero {
    background: linear-gradient(135deg, var(--light-blue-100) 0%, var(--light-blue-200) 100%);
    text-align: center;
    padding: 60px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.page-hero h1 {
    font-size: 2.4rem;
    color: var(--sky-blue-dark);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    font-weight: 800;
}

/* ТЪРСАЧКА КОМПОНЕНТ */
.filter-wrapper { margin-bottom: 35px; background-color: var(--white); padding: 20px; border-radius: 14px; box-shadow: var(--shadow-soft); }
.search-box { position: relative; width: 100%; }
.search-box i { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: var(--sky-blue); font-size: 1.2rem; }
.search-box input { width: 100%; padding: 14px 20px 14px 55px; border: 2px solid var(--light-blue-200); border-radius: 12px; font-family: inherit; font-size: 1rem; color: var(--dark-grey); transition: var(--transition-smooth); }
.search-box input:focus { outline: none; border-color: var(--sky-blue); box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1); }

/* СЕКЦИИ И КАТЕГОРИИ */
.category-section { margin-bottom: 45px; animation: fadeInLoad 0.6s ease-out forwards; }
.category-title { font-size: 1.5rem; color: var(--sky-blue-dark); font-weight: 800; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 3px solid var(--light-blue-200); display: flex; align-items: center; gap: 12px; }

/* КАРТИ ЗА ДОКУМЕНТИ */
.documents-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.document-card { background-color: var(--white); border-radius: 16px; box-shadow: var(--shadow-soft); padding: 25px; display: flex; justify-content: space-between; align-items: center; transition: transform 0.3s, box-shadow 0.3s; border: 1px solid rgba(14, 165, 233, 0.05); }
.document-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-card-hover); border-color: var(--light-blue-300); }

.doc-info { display: flex; align-items: center; gap: 22px; flex: 1; }
.doc-icon { font-size: 2.4rem; color: var(--sky-blue); width: 60px; height: 60px; background-color: var(--light-blue-100); border-radius: 12px; display: flex; align-items: center; justify-content: center; transition: var(--transition-smooth); }
.document-card:hover .doc-icon { background-color: var(--sky-blue); color: var(--white); }

.doc-details h3 { font-size: 1.2rem; color: var(--sky-blue-dark); margin-bottom: 6px; font-weight: 800; }
.doc-desc { font-size: 0.95rem; color: var(--text-slate); line-height: 1.5; }

/* БУТОНИ ЗА ДЕЙСТВИЕ */
.doc-actions { display: flex; gap: 12px; align-items: center; margin-left: 20px; }
.btn-action { padding: 12px 22px; border-radius: 10px; font-weight: 700; font-size: 0.95rem; display: inline-flex; align-items: center; gap: 8px; transition: var(--transition-smooth); border: none; cursor: pointer; }

.btn-view { background-color: var(--light-blue-100); color: var(--sky-blue-dark); }
.btn-view:hover { background-color: var(--light-blue-200); color: var(--sky-blue); }

.btn-download { background-color: var(--sky-blue); color: var(--white); box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15); }
.btn-download:hover { background-color: var(--sky-blue-dark); box-shadow: 0 6px 16px rgba(2, 132, 199, 0.25); transform: translateY(-2px); }

.no-results { text-align: center; padding: 40px; color: var(--text-muted); font-size: 1.1rem; background-color: var(--white); border-radius: 14px; box-shadow: var(--shadow-soft); }

/* --- СИСТЕМА ЗА ПАГИНАЦИЯ --- */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--white);
    padding: 8px 16px;
    border-radius: 40px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--light-blue-100);
}

.page-arrow, .page-num {
    background-color: var(--white);
    border: 1px solid rgba(2, 132, 199, 0.08);
    color: var(--sky-blue-dark);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.page-arrow:hover:not(.disabled), .page-num:hover:not(.active) {
    background-color: var(--light-blue-100);
    color: var(--sky-blue);
    border-color: var(--light-blue-300);
}

.page-num.active {
    background: linear-gradient(135deg, var(--sky-blue) 0%, var(--sky-blue-light) 100%);
    color: var(--white);
    border-color: transparent;
    box-shadow: 0 4px 10px rgba(14, 165, 233, 0.2);
}

.page-arrow.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background-color: var(--light-grey);
}

/* --- FOOTER --- */
.main-footer { background-color: var(--light-blue-100); border-top: 1px solid var(--light-blue-200); padding: 70px 0 25px 0; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 0.8fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-logo-wrapper { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; }
.footer-logo { height: 44px; width: auto; }
.footer-school-name { font-size: 1.35rem; font-weight: 800; color: var(--sky-blue-dark); }
.footer-motto { font-style: italic; color: var(--text-slate); }
.footer-title { font-size: 1.1rem; color: var(--sky-blue-dark); font-weight: 800; margin-bottom: 20px; }
.footer-links ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-links a { color: var(--text-slate); font-weight: 600; transition: var(--transition-smooth); }
.footer-links a:hover { color: var(--sky-blue); padding-left: 5px; }
.work-time { color: var(--text-slate); font-weight: 600; }
.work-time i { color: var(--sky-blue); margin-right: 5px; }
.social-title { margin-top: 20px; margin-bottom: 12px; }
.footer-socials { display: flex; gap: 10px; }
.footer-socials a { width: 38px; height: 38px; background-color: var(--white); border: 1px solid var(--light-blue-200); color: var(--sky-blue); border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: var(--transition-smooth); }
.footer-socials a:hover { background-color: var(--sky-blue); color: var(--white); transform: translateY(-3px); }
.footer-bottom { padding-top: 20px; border-top: 1px solid var(--light-blue-200); font-size: 0.9rem; color: var(--text-slate); }

@keyframes fadeInLoad { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

/* МЕДИЙНИ ЗАПИТВАНИЯ */
@media (max-width: 992px) {
    .footer-grid { grid-template-columns: 1fr; gap: 30px; }
}

@media (max-width: 768px) {
    .section { padding: 40px 0; }
    .nav-links { display: none; }
    .mobile-only-link { display: block; }
    .footer-grid { grid-template-columns: 1fr !important; gap: 30px; }
    .document-card { flex-direction: column; align-items: flex-start; gap: 20px; }
    .doc-actions { margin-left: 0; width: 100%; justify-content: flex-start; }
    .btn-action { width: 50%; justify-content: center; }
}