/* Giao Diện Hành Chính Nhà Nước Việt Nam - Tối Ưu Mobile-First & Responsive Đa Thiết Bị */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    /* Tông màu Đỏ Cờ & Vàng Ngôi Sao */
    --red-flag: #da251d;
    --red-dark: #991b1b;
    --red-deeper: #7f1d1d;
    --red-hover: #b91c1c;
    
    --gold-star: #ffde00;
    --gold-accent: #f59e0b;
    --gold-light: #fef08a;
    --gold-border: rgba(255, 222, 0, 0.4);

    --bg-main: #0f172a;
    --bg-card: rgba(30, 27, 38, 0.9);
    --bg-card-hover: rgba(45, 30, 40, 0.98);
    --bg-glass: rgba(15, 23, 42, 0.92);
    --border-color: rgba(218, 37, 29, 0.28);
    --border-gold: rgba(255, 222, 0, 0.4);

    --text-main: #ffffff;
    --text-muted: #cbd5e1;
    --text-gold: #fef08a;

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;

    --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-gold: 0 0 25px rgba(255, 222, 0, 0.2);
    
    --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-image: 
        radial-gradient(circle at 10% 10%, rgba(218, 37, 29, 0.2) 0%, transparent 45%),
        radial-gradient(circle at 90% 90%, rgba(245, 158, 11, 0.15) 0%, transparent 50%);
    background-attachment: fixed;
    line-height: 1.55;
}

/* Container Tối ưu Mobile-First */
.container {
    width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 576px) {
    .container { max-width: 540px; }
}
@media (min-width: 768px) {
    .container { max-width: 720px; padding-left: 1.25rem; padding-right: 1.25rem; }
}
@media (min-width: 992px) {
    .container { max-width: 960px; }
}
@media (min-width: 1200px) {
    .container { max-width: 1240px; }
}

/* Băng Quốc hiệu Việt Nam */
.state-banner {
    background: #7f1d1d;
    color: #fef08a;
    padding: 5px 0;
    text-align: center;
    font-size: clamp(0.68rem, 2.5vw, 0.82rem);
    font-weight: 700;
    border-bottom: 1px solid rgba(255,222,0,0.35);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Navigation & Responsive Hamburger Menu */
.navbar {
    background: linear-gradient(135deg, var(--red-deeper) 0%, var(--red-dark) 60%, var(--red-flag) 100%);
    border-bottom: 3px solid var(--gold-star);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0.65rem 0;
}

.nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #ffffff;
}

.brand-logo {
    height: 38px;
    width: auto;
    object-fit: contain;
    border-radius: var(--radius-sm);
    border: 1px solid var(--gold-star);
}

.brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--gold-star), var(--gold-accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--red-deeper);
    font-size: 1.15rem;
    box-shadow: 0 0 10px rgba(255, 222, 0, 0.5);
    border: 2px solid #ffffff;
    flex-shrink: 0;
}

.brand-title {
    font-family: var(--font-heading);
    font-size: clamp(1.1rem, 3.5vw, 1.4rem);
    font-weight: 800;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

/* Nút Toggle Menu Mobile (Hamburger) */
.nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 42px;
    height: 42px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius-sm);
    color: var(--gold-star);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-toggle:hover, .nav-toggle:active {
    background: rgba(255, 222, 0, 0.2);
}

.nav-links {
    display: none;
    list-style: none;
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 222, 0, 0.2);
}

.nav-links.active {
    display: flex;
}

.nav-link {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    padding: 0.65rem 1rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
}

.nav-link:hover, .nav-link.active {
    color: var(--gold-star);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--gold-border);
}

@media (min-width: 768px) {
    .nav-toggle { display: none; }
    .nav-wrapper { flex-wrap: nowrap; }
    .nav-links {
        display: flex;
        flex-direction: row;
        width: auto;
        margin-top: 0;
        padding-top: 0;
        border-top: none;
        align-items: center;
    }
}

/* Hero Section */
.page-hero {
    padding: 1.5rem 0 1rem;
    border-bottom: 1px dashed rgba(218, 37, 29, 0.3);
    margin-bottom: 1.5rem;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(1.4rem, 4.5vw, 2.1rem);
    font-weight: 800;
    margin-bottom: 0.35rem;
    color: var(--gold-star);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    text-shadow: 0 2px 8px rgba(218, 37, 29, 0.4);
    line-height: 1.25;
}

.hero-subtitle {
    color: var(--text-muted);
    font-size: clamp(0.85rem, 2.5vw, 0.95rem);
}

/* Nút bấm (Touch Targets 44px+) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0.65rem 1.25rem;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.92rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--red-flag), var(--red-dark));
    color: #ffffff;
    border: 1px solid var(--gold-star);
    box-shadow: 0 4px 14px rgba(218, 37, 29, 0.35);
}

.btn-primary:active, .btn-primary:hover {
    background: linear-gradient(135deg, #ef4444, var(--red-flag));
    box-shadow: 0 6px 20px rgba(255, 222, 0, 0.3);
    color: var(--gold-star);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid var(--border-color);
}

.btn-secondary:active, .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: var(--gold-star);
    color: var(--gold-star);
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    border: 1px solid #34d399;
}

.btn-danger {
    background: rgba(220, 38, 38, 0.25);
    color: #fca5a5;
    border: 1px solid rgba(220, 38, 38, 0.4);
}

.btn-danger:active, .btn-danger:hover {
    background: var(--red-flag);
    color: #fff;
}

.btn-sm {
    min-height: 36px;
    padding: 0.4rem 0.85rem;
    font-size: 0.84rem;
    border-radius: var(--radius-sm);
}

/* Stat Cards Layout Mobile First */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

@media (min-width: 576px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 992px) {
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--red-flag);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.2s;
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--gold-star);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: rgba(218, 37, 29, 0.15);
    color: var(--gold-star);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    border: 1px solid var(--border-color);
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
    border-left: 4px solid var(--gold-star);
    padding-left: 0.75rem;
}

.section-title {
    font-family: var(--font-heading);
    font-size: clamp(1.2rem, 3.5vw, 1.45rem);
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
}

/* Meeting Cards Layout */
.meetings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

@media (min-width: 768px) {
    .meetings-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1200px) {
    .meetings-grid { grid-template-columns: repeat(3, 1fr); }
}

.meeting-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    backdrop-filter: blur(14px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.meeting-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--red-flag), var(--gold-star));
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-active {
    background: rgba(218, 37, 29, 0.2);
    color: var(--gold-star);
    border: 1px solid var(--gold-star);
}

.badge-upcoming {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.badge-ended {
    background: rgba(148, 163, 184, 0.12);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.meeting-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.meeting-code {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--gold-star);
    background: rgba(255, 222, 0, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--border-gold);
}

.meeting-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 0.75rem;
    color: #ffffff;
}

.meeting-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-bottom: 1.25rem;
}

.meeting-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.meeting-actions {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 0.85rem;
    flex-wrap: wrap;
}

.meeting-actions .btn {
    flex: 1;
    min-width: 80px;
}

/* Glass Panels & Form Controls Touch-Friendly */
.glass-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    backdrop-filter: blur(16px);
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .glass-panel { padding: 1.75rem; }
}

.form-group {
    margin-bottom: 1.1rem;
}

.form-label {
    display: block;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: #ffffff;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    min-height: 44px;
    padding: 0.65rem 0.85rem;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--gold-star);
    box-shadow: 0 0 0 3px rgba(255, 222, 0, 0.2);
    background: rgba(15, 23, 42, 0.95);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 768px) {
    .form-grid { grid-template-columns: repeat(2, 1fr); }
}

/* File Upload Zone */
.upload-zone {
    border: 2px dashed var(--gold-border);
    border-radius: var(--radius-md);
    padding: 2rem 1rem;
    text-align: center;
    background: rgba(218, 37, 29, 0.05);
    transition: all 0.25s ease;
    cursor: pointer;
}

.upload-zone:active, .upload-zone:hover {
    border-color: var(--gold-star);
    background: rgba(218, 37, 29, 0.12);
}

.upload-icon {
    font-size: 2.2rem;
    color: var(--gold-star);
    margin-bottom: 0.75rem;
}

/* Documents Mobile Item */
.document-item {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
}

@media (min-width: 640px) {
    .document-item {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.doc-info {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.doc-icon {
    font-size: 1.6rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(218, 37, 29, 0.15);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.doc-name {
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    word-break: break-word;
}

.doc-name:hover {
    color: var(--gold-star);
}

.doc-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* QR Code Section */
.qr-card {
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--gold-star);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
}

.qr-image-wrapper {
    background: #ffffff;
    padding: 10px;
    border-radius: var(--radius-md);
    display: inline-block;
    box-shadow: 0 8px 25px rgba(0,0,0,0.5);
    margin-bottom: 0.85rem;
    border: 2px solid var(--gold-star);
    max-width: 260px;
}

.qr-image-wrapper img {
    display: block;
    width: 100%;
    height: auto;
}

/* Modal Overlay Touch Responsive */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    padding: 1rem;
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #1e1b26;
    border: 1px solid var(--gold-star);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.5rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.8);
    position: relative;
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--gold-star);
}

/* Footer Responsive */
footer {
    margin-top: auto;
    border-top: 2px solid var(--gold-star);
    padding: 1.5rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    background: linear-gradient(135deg, var(--red-deeper), #0f172a);
}

/* Alert Notifications */
.alert {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.9rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.18);
    border: 1px solid #34d399;
    color: #34d399;
}

.alert-danger {
    background: rgba(218, 37, 29, 0.2);
    border: 1px solid var(--red-flag);
    color: #fca5a5;
}

/* CSS Hiệu ứng Kéo thả Sắp xếp Thứ tự Tài liệu (Sortable Drag & Drop) */
.sortable-item {
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    user-select: none;
}

.sortable-item.dragging {
    opacity: 0.45;
    background: rgba(255, 222, 0, 0.15) !important;
    border: 2px dashed var(--gold-star) !important;
    transform: scale(0.98);
}

.drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    touch-action: none;
    transition: color 0.2s ease;
}

.drag-handle:hover {
    color: #ffffff !important;
}

