/* portal.css - THPT Nguyễn Văn Trỗi */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --color-primary: hsl(220, 65%, 22%);
    --color-primary-hover: hsl(220, 65%, 30%);
    --color-primary-light: hsl(220, 65%, 40%);
    --color-accent: hsl(43, 90%, 50%);
    --color-accent-dark: hsl(43, 90%, 40%);
    --color-success: hsl(145, 63%, 42%);
    --color-warning: hsl(38, 92%, 50%);
    --color-danger: hsl(0, 72%, 51%);
    --color-info: hsl(207, 90%, 54%);
    --color-text: hsl(220, 15%, 20%);
    --color-text-muted: hsl(220, 10%, 50%);
    --color-surface: hsl(220, 20%, 97%);
    --color-surface-2: hsl(220, 15%, 92%);
    --color-border: hsl(220, 20%, 88%);
    --color-white: #ffffff;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,.1);
    --shadow-lg: 0 8px 32px rgba(0,0,0,.12);
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    
    --transition: all .25s cubic-bezier(.4,0,.2,1);
    --font-sans: 'Inter', 'Segoe UI', system-ui, sans-serif;
    --header-height: 80px;
    --topbar-height: 40px;
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background-color: var(--color-surface);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}
img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; }
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
a { color: var(--color-primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--color-primary-hover); }
ul, ol { list-style: none; }

/* Typography */
h1, h2, h3, h4, h5, h6 { color: var(--color-primary); font-weight: 700; line-height: 1.2; margin-bottom: 1rem; }
h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
p { margin-bottom: 1rem; }
.text-center { text-align: center; }
.text-primary { color: var(--color-primary); }
.text-accent { color: var(--color-accent); }
.text-muted { color: var(--color-text-muted); }

/* Layout & Container */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
.section { padding: 4rem 0; }
.section-title { text-align: center; margin-bottom: 3rem; position: relative; }
.section-title::after {
    content: ''; display: block; width: 60px; height: 3px;
    background: var(--color-accent); margin: 1rem auto 0; border-radius: 2px;
}

/* Button */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.75rem 1.5rem; border-radius: var(--radius-sm); font-weight: 600;
    cursor: pointer; transition: var(--transition); border: none; text-align: center;
}
.btn-primary { background: var(--color-primary); color: var(--color-white); }
.btn-primary:hover { background: var(--color-primary-hover); color: var(--color-white); transform: translateY(-2px); }
.btn-accent { background: var(--color-accent); color: var(--color-text); }
.btn-accent:hover { background: var(--color-accent-dark); color: var(--color-text); transform: translateY(-2px); }
.btn-outline { border: 2px solid var(--color-primary); color: var(--color-primary); background: transparent; }
.btn-outline:hover { background: var(--color-primary); color: var(--color-white); }

/* Header & Navigation */
.topbar { background: var(--color-primary); color: var(--color-white); height: var(--topbar-height); font-size: 0.875rem; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; height: 100%; }
.topbar-info, .topbar-actions { display: flex; gap: 1.5rem; align-items: center; }
.topbar a { color: var(--color-white); opacity: 0.8; }
.topbar a:hover { opacity: 1; text-decoration: underline; }

.header { background: var(--color-white); box-shadow: var(--shadow-sm); position: sticky; top: 0; z-index: 1000; height: var(--header-height); transition: var(--transition); }
.header-inner { display: flex; justify-content: space-between; align-items: center; height: 100%; }
.logo-area { display: flex; align-items: center; gap: 1rem; }
.logo-img { height: 50px; width: auto; }
.logo-text { display: flex; flex-direction: column; }
.logo-title { font-size: 1.25rem; font-weight: 700; color: var(--color-primary); margin: 0; line-height: 1.2; text-transform: uppercase; }
.logo-subtitle { font-size: 0.875rem; color: var(--color-text-muted); }

.nav-menu { display: flex; gap: 2rem; height: 100%; }
.nav-item { position: relative; display: flex; align-items: center; height: 100%; }
.nav-link { font-weight: 600; color: var(--color-text); padding: 0.5rem 0; position: relative; }
.nav-link::after { content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px; background: var(--color-accent); transition: var(--transition); }
.nav-item:hover .nav-link, .nav-item.active .nav-link { color: var(--color-primary); }
.nav-item:hover .nav-link::after, .nav-item.active .nav-link::after { width: 100%; }

.dropdown-menu {
    position: absolute; top: 100%; left: 0; min-width: 200px;
    background: var(--color-white); box-shadow: var(--shadow-md);
    border-radius: var(--radius-sm); opacity: 0; visibility: hidden;
    transform: translateY(10px); transition: var(--transition); padding: 0.5rem 0; z-index: 1001;
}
.nav-item:hover .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-item { display: block; padding: 0.5rem 1rem; color: var(--color-text); font-weight: 500; }
.dropdown-item:hover { background: var(--color-surface); color: var(--color-primary); padding-left: 1.5rem; }

.mobile-menu-btn { display: none; background: none; border: none; font-size: 1.5rem; color: var(--color-primary); cursor: pointer; }

/* Hero Slider */
.hero { position: relative; height: 60vh; min-height: 400px; background: var(--color-primary); overflow: hidden; }
.hero-slide { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 0.5s ease; background-size: cover; background-position: center; }
.hero-slide.active { opacity: 1; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(to right, rgba(26,58,107,0.8), rgba(26,58,107,0.4)); }
.hero-content { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: center; color: var(--color-white); z-index: 10; max-width: 600px; }
.hero-title { font-size: 3rem; color: var(--color-white); text-shadow: 0 2px 4px rgba(0,0,0,0.3); }
.hero-desc { font-size: 1.2rem; margin-bottom: 2rem; text-shadow: 0 1px 2px rgba(0,0,0,0.3); }

/* Quick Links */
.quick-links { margin-top: -3rem; position: relative; z-index: 20; }
.ql-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1rem; background: var(--color-white); padding: 1.5rem; border-radius: var(--radius-md); box-shadow: var(--shadow-md); }
.ql-item { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.5rem; padding: 1rem; border-radius: var(--radius-sm); transition: var(--transition); }
.ql-item:hover { background: var(--color-surface); transform: translateY(-5px); color: var(--color-primary); }
.ql-icon { font-size: 2rem; color: var(--color-accent); }
.ql-text { font-weight: 600; font-size: 0.875rem; }

/* Stats Counter */
.stats { background: var(--color-primary); color: var(--color-white); padding: 4rem 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; text-align: center; }
.stat-item { padding: 1rem; }
.stat-number { font-size: 3rem; font-weight: 800; color: var(--color-accent); margin-bottom: 0.5rem; }
.stat-label { font-size: 1.1rem; font-weight: 500; }

/* News Section */
.news-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
@media(min-width: 1024px) {
    .news-grid { grid-template-columns: 2fr 1fr; }
}
.news-card { background: var(--color-white); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm); transition: var(--transition); display: flex; flex-direction: column; height: 100%; }
.news-card:hover { box-shadow: var(--shadow-md); transform: translateY(-5px); }
.news-img { width: 100%; height: 200px; object-fit: cover; }
.news-card-featured .news-img { height: 350px; }
.news-content { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; }
.news-meta { font-size: 0.875rem; color: var(--color-text-muted); margin-bottom: 0.5rem; display: flex; gap: 1rem; }
.news-title { font-size: 1.25rem; margin-bottom: 0.5rem; line-height: 1.4; }
.news-title a { color: var(--color-text); }
.news-title a:hover { color: var(--color-primary); }
.news-excerpt { color: var(--color-text-muted); font-size: 0.95rem; margin-bottom: 1rem; flex: 1; }

.small-news-list { display: flex; flex-direction: column; gap: 1.5rem; }
.small-news-item { display: flex; gap: 1rem; align-items: flex-start; }
.small-news-img { width: 120px; height: 90px; object-fit: cover; border-radius: var(--radius-sm); flex-shrink: 0; }
.small-news-content h4 { font-size: 1rem; margin-bottom: 0.25rem; line-height: 1.4; }
.small-news-content h4 a { color: var(--color-text); }
.small-news-content h4 a:hover { color: var(--color-primary); }
.small-news-meta { font-size: 0.75rem; color: var(--color-text-muted); }

/* Footer */
.footer { background: #0c1f3d; color: #e2e8f0; padding: 4rem 0 0; }
.footer-grid { display: grid; grid-template-columns: repeat(1, 1fr); gap: 2rem; margin-bottom: 3rem; }
@media(min-width: 768px) { .footer-grid { grid-template-columns: repeat(3, 1fr); } }
.footer-col h3 { color: var(--color-white); font-size: 1.2rem; margin-bottom: 1.5rem; position: relative; padding-bottom: 0.5rem; }
.footer-col h3::after { content: ''; position: absolute; bottom: 0; left: 0; width: 40px; height: 2px; background: var(--color-accent); }
.footer-links li { margin-bottom: 0.75rem; }
.footer-links a { color: #cbd5e1; }
.footer-links a:hover { color: var(--color-accent); padding-left: 5px; }
.footer-contact li { display: flex; gap: 1rem; margin-bottom: 1rem; align-items: flex-start; }
.footer-contact i { color: var(--color-accent); margin-top: 0.25rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding: 1.5rem 0; text-align: center; font-size: 0.875rem; color: #94a3b8; }

/* Responsive */
@media(max-width: 768px) {
    .topbar { display: none; }
    .nav-menu { position: fixed; top: var(--header-height); left: -100%; width: 80%; height: calc(100vh - var(--header-height)); background: var(--color-white); flex-direction: column; padding: 2rem; box-shadow: var(--shadow-lg); transition: var(--transition); gap: 1rem; }
    .nav-menu.active { left: 0; }
    .mobile-menu-btn { display: block; }
    .ql-grid { grid-template-columns: repeat(3, 1fr); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-title { font-size: 2rem; }
}
@media(max-width: 480px) {
    .ql-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: 1fr; }
}

/* Auth Cards */
.auth-wrap { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - var(--header-height) - 100px); padding: 2rem 1rem; }
.auth-card { background: var(--color-white); padding: 2rem; border-radius: var(--radius-md); box-shadow: var(--shadow-lg); width: 100%; max-width: 400px; text-align: center; }
.form-group { margin-bottom: 1.5rem; text-align: left; }
.form-label { display: block; font-weight: 500; margin-bottom: 0.5rem; color: var(--color-text); }
.form-control { width: 100%; padding: 0.75rem 1rem; border: 1px solid var(--color-border); border-radius: var(--radius-sm); transition: var(--transition); }
.form-control:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(26,58,107,0.1); }

/* Tables */
.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; background: var(--color-white); }
.table th, .table td { padding: 1rem; border: 1px solid var(--color-border); text-align: left; }
.table th { background: var(--color-surface); font-weight: 600; color: var(--color-primary); }
.table tbody tr:hover { background: var(--color-surface-2); }

/* Flash Messages */
.flash-messages { position: fixed; top: calc(var(--header-height) + 1rem); right: 1rem; z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem; }
.alert { padding: 1rem 1.5rem; border-radius: var(--radius-sm); color: #fff; box-shadow: var(--shadow-md); animation: slideIn 0.3s ease forwards; max-width: 350px; }
.alert-success { background: var(--color-success); }
.alert-error, .alert-danger { background: var(--color-danger); }
.alert-warning { background: var(--color-warning); color: var(--color-text); }
.alert-info { background: var(--color-info); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Utility */
.d-none { display: none; }
.mb-1 { margin-bottom: 0.25rem; } .mb-2 { margin-bottom: 0.5rem; } .mb-3 { margin-bottom: 1rem; } .mb-4 { margin-bottom: 1.5rem; } .mb-5 { margin-bottom: 3rem; }
.mt-3 { margin-top: 1rem; } .mt-4 { margin-top: 1.5rem; } .mt-5 { margin-top: 3rem; }
.gap-2 { gap: 0.5rem; } .gap-3 { gap: 1rem; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.w-100 { width: 100%; }
.card { background: #fff; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding: 1.5rem; }
.badge { padding: 0.25rem 0.5rem; border-radius: 4px; font-size: 0.75rem; font-weight: 600; }
.badge-primary { background: var(--color-primary-light); color: #fff; }

/* Breadcrumb */
.breadcrumb { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 2rem; font-size: 0.875rem; }
.breadcrumb a { color: var(--color-text-muted); }
.breadcrumb span { color: var(--color-text); font-weight: 500; }

/* Document Library */
.doc-list { display: flex; flex-direction: column; gap: 1rem; }
.doc-item { display: flex; align-items: center; justify-content: space-between; padding: 1rem; background: var(--color-white); border: 1px solid var(--color-border); border-radius: var(--radius-sm); transition: var(--transition); }
.doc-item:hover { border-color: var(--color-primary); box-shadow: var(--shadow-sm); }
.doc-info { display: flex; align-items: center; gap: 1rem; }
.doc-icon { font-size: 2rem; color: var(--color-danger); }
.doc-meta { font-size: 0.875rem; color: var(--color-text-muted); display: flex; gap: 1rem; }

/* Events Calendar */
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--color-border); border: 1px solid var(--color-border); }
.calendar-header { background: var(--color-surface); text-align: center; padding: 0.5rem; font-weight: 600; }
.calendar-day { background: var(--color-white); min-height: 100px; padding: 0.5rem; }
.calendar-day.other-month { background: var(--color-surface); color: var(--color-text-muted); }
.calendar-event { background: var(--color-primary-light); color: var(--color-white); padding: 0.25rem 0.5rem; border-radius: 4px; font-size: 0.75rem; margin-top: 0.25rem; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Timetable */
.timetable td { text-align: center; vertical-align: middle; height: 60px; }
.tt-subject { font-weight: 600; color: var(--color-primary); display: block; }
.tt-teacher { font-size: 0.8rem; color: var(--color-text-muted); display: block; }

/* Ticker */
.ticker-wrap { background: var(--color-warning); color: var(--color-text); padding: 0.5rem 0; overflow: hidden; display: flex; align-items: center; }
.ticker-label { font-weight: bold; padding-right: 1rem; border-right: 2px solid rgba(0,0,0,0.1); margin-right: 1rem; flex-shrink: 0; }
.ticker-content { flex: 1; overflow: hidden; }
.ticker-text { display: inline-block; white-space: nowrap; animation: ticker 20s linear infinite; }
@keyframes ticker { 0% { transform: translateX(100%); } 100% { transform: translateX(-100%); } }

/* Article Details */
.article-header { margin-bottom: 2rem; }
.article-meta { display: flex; gap: 1rem; color: var(--color-text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--color-border); padding-bottom: 1rem; }
.article-body { font-size: 1.1rem; line-height: 1.8; color: var(--color-text); }
.article-body img { margin: 2rem auto; border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }
.article-body h2, .article-body h3 { margin-top: 2rem; margin-bottom: 1rem; }

/* Utilities */
.text-white { color: var(--color-white) !important; }
