* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-family-base);
    background: var(--color-bg);
    color: var(--color-text);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.center-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: var(--color-bg);
}

.login-card {
    width: min(420px, calc(100% - 32px));
    padding: 32px;
    background: var(--color-surface);
    color: var(--color-text);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 700;
    color: var(--color-text);
}

.login-brand-logo {
    height: 40px;
    width: auto;
    border-radius: 8px;
}

label {
    display: block;
    margin: 18px 0 7px;
    font-weight: 600;
}

input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    font-size: 16px;
    background: var(--color-surface);
    color: var(--color-text);
}

button {
    margin-top: 22px;
    padding: 11px 18px;
    border: 0;
    border-radius: var(--radius-md);
    background: var(--color-ink);
    color: var(--color-text-on-primary);
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.15s ease, transform 0.05s ease;
}

button:hover {
    opacity: 0.88;
}

button:active {
    transform: translateY(1px);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

button.secondary {
    margin: 0;
    background: var(--color-border-strong);
    color: var(--color-text);
}

.muted {
    color: var(--color-text-muted);
}

.error {
    margin-top: 18px;
    padding: 12px;
    background: var(--color-error-bg);
    color: var(--color-error-text);
    border-radius: 8px;
}

.topbar {
    min-height: 64px;
    padding: 12px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--color-header-bg);
    color: white;
}

.theme-toggle {
    margin: 0;
    padding: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-full);
    color: white;
    cursor: pointer;
}

.theme-toggle:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.12);
}

.theme-toggle-icon {
    display: none;
}

/* Mặc định (chưa rõ theme / light): hiện icon mặt trời. */
.theme-toggle-icon-sun {
    display: block;
}

:root[data-theme="dark"] .theme-toggle-icon-sun {
    display: none;
}

:root[data-theme="dark"] .theme-toggle-icon-moon {
    display: block;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle-icon-sun {
        display: none;
    }

    :root:not([data-theme="light"]) .theme-toggle-icon-moon {
        display: block;
    }
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 20px;
}

.welcome {
    margin-bottom: 28px;
}

.hero {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

/*
 * Banner THUẦN ẢNH - không chữ, không overlay/gradient đè lên. Giữ
 * đúng tỷ lệ 21:9 đã crop ở /admin/homepage-settings (Cropper.js) nên
 * background-size:cover không bao giờ phải co giãn lệch tỷ lệ.
 */
.hero-banner-image {
    width: 100%;
    aspect-ratio: 21 / 9;
    background-size: cover;
    background-position: center;
    border-radius: var(--radius-lg);
}

.hero-content {
    padding: var(--space-6);
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.hero-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-5);
    margin-top: var(--space-6);
    padding-top: var(--space-5);
    border-top: 1px solid var(--color-border);
}

.hero-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hero-stat-icon {
    font-size: 22px;
    margin-bottom: 4px;
}

.hero-stat strong {
    font-size: 15px;
}

.hero-stat .muted {
    font-size: 12px;
}

@media (max-width: 640px) {
    .hero-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}

.card {
    padding: var(--space-6);
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.number {
    margin: 12px 0;
    font-size: 36px;
    font-weight: 700;
}

.status {
    display: inline-block;
    margin: 12px 0;
    padding: 7px 11px;
    border-radius: 999px;
    font-weight: 700;
}

.offline {
    background: var(--color-error-bg);
    color: var(--color-error-text);
}

.notice {
    margin-bottom: 20px;
}

.success {
    padding: 12px;
    background: var(--color-success-bg);
    color: var(--color-success-text);
    border-radius: 8px;
}

.summary-grid {
    margin-bottom: 22px;
}

.panel {
    margin-top: 22px;
    padding: var(--space-6);
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.robot-form {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 16px;
}

.full-width {
    grid-column: 1 / -1;
}

.robot-form button {
    margin-top: 0;
}

.robot-list {
    display: grid;
    gap: 14px;
}

.robot-item {
    padding: 18px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.robot-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.robot-title-row h3 {
    margin: 0;
}

.robot-main code {
    display: inline-block;
    max-width: 100%;
    padding: 8px 10px;
    background: var(--color-surface-subtle);
    color: var(--color-text);
    border-radius: 7px;
    overflow-wrap: anywhere;
}

.robot-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.robot-actions button {
    margin: 0;
}

button.danger {
    background: var(--color-error-solid);
}

.badge {
    padding: 5px 9px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 700;
}

.badge.enabled {
    background: var(--color-success-bg);
    color: var(--color-success-text);
}

.badge.disabled {
    background: var(--color-border);
    color: var(--color-text-secondary);
}

.badge.offline {
    background: var(--color-error-bg);
    color: var(--color-error-text);
}

/* Class trạng thái chuẩn (design system) - dùng cho badge/tag bất kỳ,
   thay cho việc mượn tạm class .status-* / .badge.enabled... như trước.
   Các template hiện có CHƯA đổi sang class này (giai đoạn sau sẽ dọn). */
.badge-success {
    background: var(--color-success-bg);
    color: var(--color-success-text);
}

.badge-warning {
    background: var(--color-warning-bg);
    color: var(--color-warning-text);
}

.badge-error {
    background: var(--color-error-bg);
    color: var(--color-error-text);
}

.badge-info {
    background: var(--color-info-bg);
    color: var(--color-info-text);
}

@media (max-width: 720px) {
    .robot-form {
        grid-template-columns: 1fr;
    }

    .full-width {
        grid-column: auto;
    }

    .robot-item {
        flex-direction: column;
    }
}

.badge.status-online {
    background: var(--color-success-bg);
    color: var(--color-success-text);
}

.badge.status-connecting {
    background: var(--color-warning-bg);
    color: var(--color-warning-text);
}

.badge.status-offline {
    background: var(--color-error-bg);
    color: var(--color-error-text);
}

/* ---- Nav bar (Phần A) ---- */

.topbar {
    flex-wrap: wrap;
    gap: 12px;
}

.topbar-left {
    display: flex;
    align-items: center;
}

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

.navbar-logo {
    height: 36px;
    width: auto;
    border-radius: 6px;
}

.navbar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.navbar {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.navbar a {
    padding: 8px 14px;
    border-radius: 8px;
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.navbar a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.navbar a.active {
    background: var(--color-primary);
    color: white;
}

/* ---- Service status strip + activity log (Trang chủ) ---- */

.service-status-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 22px;
}

.service-status-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--color-surface);
    color: var(--color-text);
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
    font-size: 14px;
    font-weight: 600;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #94a3b8;
    flex: none;
}

.status-dot.ok {
    background: #22c55e;
}

.status-dot.warn {
    background: #f59e0b;
}

.status-dot.off {
    background: #cbd5e1;
}

.activity-list {
    display: grid;
    gap: 2px;
}

.activity-item {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 4px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-message {
    color: #1f2937;
}

.activity-time {
    color: #94a3b8;
    white-space: nowrap;
}

/* ---- Dịch vụ: lưới thẻ ---- */

.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.service-card {
    padding: 22px;
    background: var(--color-surface);
    color: var(--color-text);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.service-card h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.service-card p {
    margin: 0;
    color: var(--color-text-muted);
    flex-grow: 1;
}

.service-card.coming-soon {
    opacity: 0.55;
    filter: grayscale(0.4);
    pointer-events: none;
}

.service-card .badge.soon {
    background: #e2e8f0;
    color: #475569;
}

/* ---- Lưới sản phẩm/dịch vụ trang chủ - carousel (mũi tên + chấm
   trang) - xem templates/home.html ---- */

.product-carousel-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 18px;
}

.carousel-arrow {
    width: 38px;
    height: 38px;
    padding: 0;
    margin: 0;
    border-radius: 50%;
    background: #111827;
    color: white;
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.product-carousel-dots {
    display: flex;
    gap: 8px;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    margin: 0;
    border-radius: 50%;
    background: #cbd5e1;
    cursor: pointer;
}

.carousel-dot.active {
    background: #111827;
}

/* ---- Section "Giới thiệu MioraTech" ở trang chủ - xem
   templates/home.html, app/web/helpers.py::_footer_about_info không
   liên quan (đây lấy trực tiếp từ context, không qua Jinja global) ---- */

.about-excerpt-grid {
    display: grid;
    grid-template-columns: minmax(0, 260px) 1fr;
    gap: 26px;
    align-items: center;
}

.about-excerpt-image {
    width: 100%;
    border-radius: 14px;
    object-fit: cover;
}

@media (max-width: 640px) {
    .about-excerpt-grid {
        grid-template-columns: 1fr;
    }
}

/* ---- Firmware ---- */

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
    color: var(--color-text);
}

.data-table th,
.data-table td {
    text-align: left;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-border);
    overflow-wrap: anywhere;
}

.data-table th {
    color: var(--color-text-muted);
    font-weight: 700;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.data-table tbody tr:nth-child(even) {
    background: var(--color-surface-subtle);
}

/* ---- /admin - sidebar điều hướng dọc (templates/admin_base.html) ---- */

.container-admin {
    max-width: 1400px;
}

.admin-layout {
    display: flex;
    gap: var(--space-6);
    align-items: flex-start;
}

.admin-sidebar {
    width: 220px;
    flex: none;
    position: sticky;
    top: 16px;
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.admin-sidebar-group {
    margin-top: var(--space-4);
}

.admin-sidebar-group:first-child {
    margin-top: 0;
}

.admin-sidebar-group-label {
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    padding: 0 var(--space-3) var(--space-1);
    font-weight: var(--fw-semibold);
}

.admin-sidebar a {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: var(--fw-medium);
}

.admin-sidebar a:hover {
    background: var(--color-surface-subtle);
}

.admin-sidebar a.active {
    background: var(--color-primary);
    color: #fff;
}

.admin-content {
    flex: 1;
    min-width: 0;
}

@media (max-width: 900px) {
    .admin-layout {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        position: static;
        gap: var(--space-4);
    }

    .admin-sidebar-group {
        margin-top: 0;
        display: flex;
        flex-direction: column;
        flex: none;
    }
}

/* ---- Tab ngang (component chuẩn - chưa có trang nào trong project
   này dùng, chuẩn bị sẵn cho giai đoạn sau) ---- */

.tabs {
    display: flex;
    gap: var(--space-2);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: var(--space-6);
    overflow-x: auto;
}

.tab {
    padding: var(--space-3) var(--space-4);
    border: 0;
    margin: 0;
    background: transparent;
    color: var(--color-text-muted);
    font-weight: var(--fw-semibold);
    font-size: var(--text-sm);
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    border-radius: 0;
}

.tab:hover {
    color: var(--color-text);
    opacity: 1;
}

.tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.changelog-list {
    display: grid;
    gap: 14px;
}

.changelog-item {
    padding-left: 14px;
    border-left: 3px solid #2563eb;
}

.changelog-item h4 {
    margin: 0 0 4px;
}

.changelog-item p {
    margin: 0;
    color: #64748b;
}

/* ---- Hướng dẫn ---- */

.guide-section {
    margin-bottom: 8px;
}

.guide-section h2 {
    margin-bottom: 10px;
}

.guide-section ol,
.guide-section ul {
    margin: 0;
    padding-left: 22px;
    color: #334155;
}

.guide-section li {
    margin-bottom: 6px;
}

.command-table td:first-child {
    font-weight: 700;
    white-space: nowrap;
}

/* ---- Login / register extras ---- */

.divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0;
    color: #94a3b8;
    font-size: 13px;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.btn-google {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: white;
    color: #1f2937;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    box-sizing: border-box;
}

.auth-switch {
    margin-top: 18px;
    text-align: center;
    font-size: 14px;
}

.auth-switch a {
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
}

/* ---- Webhook / copy field (thẻ Thông báo ngân hàng) ---- */

.copy-field {
    display: flex;
    gap: 8px;
}

.copy-field input {
    flex: 1;
    background: var(--color-surface-subtle);
    font-family: monospace;
    font-size: 13px;
}

.copy-field button {
    margin: 0;
    white-space: nowrap;
}

/* ---- Nạp / xóa firmware qua USB ---- */

.flash-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.port-select {
    min-width: 200px;
}

.danger-zone {
    margin-top: 24px;
    padding: 16px;
    border: 1px solid var(--color-error-border);
    border-radius: 8px;
    background: var(--color-error-bg);
    color: var(--color-error-text);
}

.danger-zone h3 {
    margin-top: 0;
}

.flash-log {
    margin-top: 16px;
    max-height: 320px;
    overflow-y: auto;
    background: #0f172a;
    color: #e2e8f0;
    padding: 12px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 12px;
    white-space: pre-wrap;
}

/* ---- Modal cấu hình dịch vụ (Dịch vụ > Cấu hình) ---- */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 100;
}

.modal-overlay.open {
    display: flex;
}

.modal {
    position: relative;
    background: var(--color-surface);
    color: var(--color-text);
    border-radius: 10px;
    padding: 24px;
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal h3 {
    margin-top: 0;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--color-surface-subtle);
    color: var(--color-text-secondary);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    margin: 0;
}

.modal-close:hover {
    background: var(--color-border);
}

/* ---- Accordion (hướng dẫn CLI, Build & Publish, upload thủ công) ---- */

.accordion {
    margin-bottom: 12px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    overflow: hidden;
}

.accordion summary {
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 600;
    background: var(--color-surface-subtle);
    color: var(--color-text);
    list-style: none;
}

.accordion summary::-webkit-details-marker {
    display: none;
}

.accordion summary::before {
    content: "▸";
    display: inline-block;
    margin-right: 8px;
    transition: transform 0.15s ease;
}

.accordion details[open] summary::before {
    transform: rotate(90deg);
}

.accordion summary:hover {
    background: var(--color-border);
}

.accordion-body {
    padding: 16px;
    border-top: 1px solid var(--color-border);
}

.badge.latest {
    background: var(--color-success-bg);
    color: var(--color-success-text);
}

/* ---- Trang Firmware: khu vực chính nổi bật + thẻ release ---- */

.accordion-primary {
    border: 2px solid var(--color-primary);
    box-shadow: 0 5px 20px rgba(37, 99, 235, 0.12);
}

.accordion-primary summary {
    background: var(--color-info-bg);
    color: var(--color-info-text);
    font-size: 15px;
}

.accordion-primary summary:hover {
    background: var(--color-primary-100);
}

.accordion-secondary summary {
    font-weight: 500;
    color: var(--color-text-secondary);
}

.firmware-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-5);
    margin-top: 16px;
}

.firmware-card {
    padding: var(--space-5);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.firmware-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary);
}

.firmware-card-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.firmware-card-title h3 {
    margin: 0;
    font-size: var(--text-lg);
    font-weight: var(--fw-semibold);
}

.firmware-card-title h3 a {
    color: var(--color-text);
    text-decoration: none;
}

.firmware-card-title h3 a:hover {
    color: var(--color-primary);
}

.board-card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-md);
    object-fit: cover;
    display: block;
    border: 1px solid var(--color-border);
    background: var(--color-surface-subtle);
}

.badge.signed {
    background: #dcfce7;
    color: #166534;
}

.badge.unsigned {
    background: #fef3c7;
    color: #92400e;
}

.firmware-card-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
}

.icon-btn {
    padding: 7px 10px;
    font-size: 15px;
    line-height: 1;
    margin: 0;
}

/* ---- Trang /pricing: thẻ so sánh gói dịch vụ ---- */

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 20px;
    align-items: stretch;
}

.pricing-card {
    position: relative;
    padding: 26px 22px;
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.pricing-card.featured {
    border: 2px solid #2563eb;
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.18);
    transform: translateY(-4px);
}

.pricing-card.current {
    border-color: #16a34a;
}

.pricing-featured-tag {
    position: absolute;
    top: -12px;
    left: 22px;
    background: #2563eb;
    color: white;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
}

.pricing-plan-name {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.pricing-price {
    font-size: 32px;
    font-weight: 800;
    color: var(--color-text);
}

.pricing-price span {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-muted);
}

.pricing-meta {
    font-size: 13px;
    color: var(--color-text-muted);
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 8px;
    flex: 1;
}

.feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
}

.feature-check {
    color: #16a34a;
    font-weight: 700;
}

@media (max-width: 720px) {
    .pricing-card.featured {
        transform: none;
    }
}

@media (max-width: 720px) {
    .navbar {
        order: 3;
        width: 100%;
        justify-content: flex-start;
    }
}

/* ---- Footer + icon liên hệ nổi (floating) - xem templates/base.html,
   app/web/helpers.py::_footer_contact_links ---- */

.site-footer {
    background: var(--color-header-bg);
    color: #94a3b8;
    padding: 40px 20px 20px;
    font-size: 13px;
}

.footer-columns {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
    gap: 28px;
    text-align: left;
}

.footer-column h4 {
    margin: 0 0 10px;
    color: white;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.footer-column a {
    display: block;
    color: #94a3b8;
    text-decoration: none;
    margin-bottom: 8px;
}

.footer-column a:hover {
    color: white;
}

.footer-column .muted {
    color: #6b7789;
    margin: 0 0 8px;
}

.footer-logo {
    height: 38px;
    width: auto;
    margin-bottom: 10px;
}

.footer-copyright {
    text-align: center;
    margin: 28px 0 0;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 720px) {
    .footer-columns {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .footer-columns {
        grid-template-columns: 1fr;
    }
}

.floating-contact-links {
    position: fixed;
    right: 18px;
    bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 100;
}

.floating-contact-link {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--color-surface);
    box-shadow: var(--shadow-md);
    font-size: 20px;
    text-decoration: none;
    transition: transform 0.15s ease;
}

.floating-contact-link:hover {
    transform: scale(1.08);
}

/* ---- Nội dung Markdown render sẵn (bài viết, /about...) ---- */

.rich-content img {
    max-width: 100%;
    border-radius: 10px;
    margin: 8px 0;
}

.rich-content p {
    line-height: 1.6;
}

/* ---- Toolbar "Chèn ảnh"/"Chèn video" trên khung soạn Markdown ---- */

.editor-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.editor-toolbar button {
    margin: 0;
    padding: 6px 12px;
    font-size: 13px;
}

/* ---- Nhúng video YouTube trong nội dung Markdown (16:9 responsive) ---- */

.video-embed {
    position: relative;
    padding-top: 56.25%;
    margin: 16px 0;
    border-radius: 12px;
    overflow: hidden;
    background: #0f172a;
}

.video-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
