/* =========================
   FRONTEND BASE
========================= */

.fx-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.fx-section {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.fx-title {
    font-size: 24px;
    font-weight: 800;
    color: #111827;
    line-height: 1.25;
}

.fx-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin-top: 4px;
}

.fx-muted {
    color: #6b7280;
}

.fx-link {
    color: #4f46e5;
    font-weight: 600;
    text-decoration: none;
}

.fx-link:hover {
    text-decoration: underline;
}

/* =========================
   BUTTONS
========================= */

.fx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: 12px;
    border: none;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: 0.18s ease;
    white-space: nowrap;
}

.fx-btn-primary {
    background: #4f46e5;
    color: #ffffff;
}

.fx-btn-primary:hover {
    background: #4338ca;
}

.fx-btn-dark {
    background: #111827;
    color: #ffffff;
}

.fx-btn-dark:hover {
    background: #1f2937;
}

.fx-btn-danger {
    background: #16a34a;
    color: #ffffff;
}

.fx-btn-danger:hover {
    background: #b91c1c;
}

.fx-btn-soft {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.fx-btn-soft:hover {
    background: #e5e7eb;
}

.fx-btn-green {
    background: #16a34a;
    color: #ffffff;
}

.fx-btn-green:hover {
    background: #15803d;
}

.fx-btn[disabled] {
    opacity: 0.65;
    cursor: not-allowed;
}

/* =========================
   BADGES
========================= */

.fx-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.fx-badge-new {
    background: #dc2626;
    color: #ffffff;
}

.fx-badge-soft-red {
    background: #fee2e2;
    color: #b91c1c;
}

.fx-badge-soft-indigo {
    background: #eef2ff;
    color: #4338ca;
}

.fx-badge-soft-green {
    background: #dcfce7;
    color: #15803d;
}

/* =========================
   ACCOUNT
========================= */

.fx-account-hero {
    overflow: hidden;
    margin-bottom: 24px;
}

.fx-account-header {
    background: #374151;
    padding: 28px 32px;
    color: #ffffff;
}

.fx-account-top {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto auto auto;
    align-items: center;
    gap: 24px;
}

.fx-account-user {
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 0;
}

.fx-account-avatar {
    width: 96px;
    height: 96px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: 800;
    flex-shrink: 0;
}

.fx-account-hello {
    opacity: 0.85;
    font-size: 14px;
    margin: 0 0 4px;
}

.fx-account-name {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.2;
    margin: 0;
}

.fx-account-email {
    font-size: 14px;
    opacity: 0.9;
    margin-top: 8px;
    word-break: break-word;
}

.fx-account-status {
    display: inline-flex;
    margin-top: 12px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.25);
    font-size: 14px;
    font-weight: 700;
}

.fx-account-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.fx-account-action-btn {
    min-width: 220px;
    height: 44px;
    border: 0;
    border-radius: 12px;
    background: #16a34a;
    color: #ffffff;
    font-weight: 900;
    cursor: pointer;
    padding: 0 18px;
    transition: 0.18s ease;
}

.fx-account-action-btn:hover {
    background: #15803d;
}

.fx-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-top: 28px;
}

.fx-stat-card {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    padding: 16px;
    color: #ffffff;
    text-decoration: none;
    min-width: 0;
}

.fx-stat-label {
    font-size: 12px;
    opacity: 0.85;
    margin: 0;
}

.fx-stat-value {
    font-size: 18px;
    font-weight: 800;
    margin-top: 8px;
    word-break: break-word;
}

.fx-account-menu {
    padding: 16px;
    background: #ffffff;
}

.fx-menu-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.fx-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #f9fafb;
    color: #374151;
    border: 1px solid #e5e7eb;
    font-weight: 700;
    text-decoration: none;
    transition: 0.18s ease;
}

.fx-menu-item:hover {
    background: #f3f4f6;
}

.fx-menu-item.active {
    background: #eef2ff;
    color: #4338ca;
    border-color: #c7d2fe;
}

@media (max-width: 1023px) {
    .fx-account-top {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .fx-account-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 767px) {
    .fx-account-header {
        padding: 26px 20px;
    }

    .fx-account-top {
        gap: 18px;
    }

    .fx-account-user {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .fx-account-avatar {
        width: 88px;
        height: 88px;
        font-size: 36px;
    }

    .fx-account-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        width: 100%;
    }

    .fx-account-action-btn {
        width: 100%;
        min-width: 0;
    }

    .fx-account-top > .fx-stat-card {
        width: 100%;
    }

    .fx-account-top form {
        width: 100%;
    }

    .fx-account-top form .fx-btn {
        width: 100%;
    }

    .fx-stat-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-top: 22px;
    }

    .fx-menu-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================
   LIST ITEMS
========================= */

.fx-list {
    display: grid;
    gap: 12px;
}

.fx-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 16px;
    background: #ffffff;
    transition: 0.18s ease;
}

.fx-list-item:hover {
    background: #f9fafb;
}

.fx-list-item-red {
    border-color: #fecaca;
    background: #fef2f2;
}

.fx-list-item-red:hover {
    background: #fee2e2;
}

.fx-list-title {
    font-weight: 800;
    color: #111827;
    text-decoration: none;
}

.fx-list-title:hover {
    color: #4f46e5;
}

.fx-list-desc {
    font-size: 14px;
    color: #6b7280;
    margin-top: 4px;
}

.fx-list-time {
    font-size: 12px;
    color: #9ca3af;
    white-space: nowrap;
}

/* =========================
   STORY CARD GRID
========================= */

.fx-story-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.fx-story-card {
    display: block;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: 0.18s ease;
}

.fx-story-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.fx-story-cover {
    aspect-ratio: 3 / 4;
    background: #f3f4f6;
}

.fx-story-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fx-story-body {
    padding: 12px;
}

.fx-story-title {
    font-size: 14px;
    font-weight: 800;
    color: #111827;
    line-height: 1.35;
}

.fx-story-meta {
    font-size: 12px;
    color: #6b7280;
    margin-top: 6px;
}

.fx-story-latest {
    font-size: 12px;
    color: #4f46e5;
    font-weight: 700;
    margin-top: 6px;
}

/* =========================
   EMPTY
========================= */

.fx-empty {
    border: 1px dashed #d1d5db;
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    color: #6b7280;
    background: #ffffff;
}

/* =========================
   TOAST
========================= */

.fx-toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9999;
    padding: 12px 16px;
    border-radius: 12px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    transition: 0.2s ease;
}

.fx-toast-success {
    background: #16a34a;
}

.fx-toast-error {
    background: #dc2626;
}

/* =========================
   RESPONSIVE
========================= */

@media (min-width: 768px) {
    .fx-story-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .fx-story-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .fx-account-top {
        flex-direction: column;
        align-items: stretch;
    }

    .fx-account-user {
        flex-direction: row;
        align-items: center;
        gap: 14px;
        width: 100%;
    }

    .fx-account-avatar {
        width: 78px;
        height: 78px;
        font-size: 34px;
    }

    .fx-account-hello {
        opacity: .85;
        font-size: 13px;
        margin: 0 0 4px;
    }

    .fx-account-name {
        font-size: 22px;
        margin: 0;
    }

    .fx-account-email {
        font-size: 13px;
        margin-top: 6px;
        word-break: break-word;
    }

    .fx-stat-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }

    .fx-menu-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }

    .fx-list-item {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* =========================
   SAFE LOGO FIX
========================= */

.site-header-row{
    margin-left: 2em;
}

.site-logo-safe {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    flex-shrink: 0;
    width: auto;
    overflow: hidden;
    text-decoration: none;
}

.site-logo-safe img {
    display: block;

    max-width: 80px ;
    max-height: 80px ;

    width: auto;
    height: auto;

    object-fit: contain !important;
}

@media (max-width: 767px) {
    .site-logo-safe {
        max-width: 80px;
        height: 80px;
    }

    .site-logo-safe img {
        max-width: 80px !important;
        max-height: 80px !important;
    }
}


/* =========================
   HOT STORY SLIDER
========================= */

.hot-slider-shell {
    width: 100%;
    overflow: hidden;

    --hot-auto-delay: 5000;
    --hot-slide-duration: 550ms;
    --hot-slide-gap: 16px;
}

.hot-story-slider {
    display: flex !important;
    gap: var(--hot-slide-gap);
    width: 100%;

    overflow: visible;
    transform: translate3d(0, 0, 0);
    transition: transform var(--hot-slide-duration) ease;

    will-change: transform;
    touch-action: pan-y;
    user-select: none;

    padding-bottom: 4px;
}

.hot-story-slider.is-jump {
    transition: none !important;
}

.hot-story-slider.is-dragging {
    transition: none !important;
    cursor: grabbing;
}

.hot-story-card {
    flex: 0 0 calc((100% - 66px) / 5);
    min-width: 0;
}

.hot-slide-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 34px;
    height: 34px;

    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #ffffff;
    color: #111827;

    font-size: 24px;
    font-weight: 800;
    line-height: 1;

    cursor: pointer;
    transition: 0.18s ease;
}

.hot-slide-btn:hover {
    background: #f3f4f6;
    color: #4f46e5;
}

@media (max-width: 1023px) {
    .hot-story-card {
        flex-basis: calc((100% - 32px) / 3);
    }
}

@media (max-width: 767px) {
    .hot-story-card {
        flex-basis: calc((100% - 16px) / 2);
    }

    .hot-slide-btn {
        width: 32px;
        height: 32px;
        font-size: 22px;
    }
}

@media (max-width: 420px) {
    .hot-story-card {
        flex-basis: calc((100% - 16px) / 2);
    }
}

/* =========================
   HEADER NAV RESPONSIVE FIX
========================= */

/*
   app.blade.php đang dùng các class:
   - .site-header-row: hàng chứa logo + desktop nav + nút mobile
   - .site-desktop-nav: menu desktop
   - .site-mobile-toggle: nút ☰ mobile
   - #mobileMenu.site-mobile-menu: menu xổ xuống mobile
*/

.site-header-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px !important;
    margin-left: 0 !important;
}

.site-desktop-nav {
    align-items: center !important;
    gap: 16px !important;
    margin-left: auto !important;
}

.site-mobile-toggle {
    flex-shrink: 0;
}

#mobileMenu.site-mobile-menu {
    width: 100%;
}

/* Mobile: chỉ hiện logo + nút ☰, ẩn menu desktop */
@media (max-width: 767px) {
    .site-header-row {
        margin-left: 0 !important;
    }

    .site-desktop-nav {
        display: none !important;
    }

    .site-mobile-toggle {
        display: inline-flex !important;
    }

    #mobileMenu.site-mobile-menu {
        display: none !important;
    }

    #mobileMenu.site-mobile-menu.is-open {
        display: block !important;
    }
}

/* Desktop: hiện menu ngang, ẩn nút ☰ và menu mobile */
@media (min-width: 768px) {
    .site-desktop-nav {
        display: flex !important;
    }

    .site-mobile-toggle {
        display: none !important;
    }

    #mobileMenu.site-mobile-menu {
        display: none !important;
    }
}


/* =========================
   DONATION RESPONSIVE LAYOUT
========================= */

/* Mobile mặc định: không dùng grid */
.donation-main-layout,
.donation-qr-layout {
    display: block;
}

.donation-main-layout > div + div,
.donation-qr-layout > div + div {
    margin-top: 20px;
}

/* Tablet + Desktop: mới dùng grid */
@media (min-width: 768px) {
    .donation-main-layout {
        display: grid;
        grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr);
        gap: 24px;
        align-items: start;
    }

    .donation-qr-layout {
        display: grid;
        grid-template-columns: 260px 1fr;
        gap: 20px;
        align-items: start;
    }

    .donation-main-layout > div + div,
    .donation-qr-layout > div + div {
        margin-top: 0;
    }
}

/* =========================
   DONATION RECENT RESPONSIVE
========================= */

.donation-recent-table-wrap {
    overflow-x: auto;
    margin-top: 18px;
}

.donation-recent-mobile-list {
    display: none;
}

@media (max-width: 767px) {
    .donation-recent-table-wrap {
        display: none !important;
    }

    .donation-recent-mobile-list {
        display: grid;
        gap: 12px;
        margin-top: 16px;
    }

    .donation-recent-card {
        background: #ffffff;
        border: 1px solid #e5e7eb;
        border-radius: 16px;
        padding: 14px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }

    .donation-recent-card-head {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        align-items: flex-start;
        padding-bottom: 12px;
        border-bottom: 1px solid #f3f4f6;
        margin-bottom: 12px;
    }

    .donation-recent-label {
        font-size: 12px;
        color: #6b7280;
        font-weight: 700;
        margin: 0;
    }

    .donation-recent-name {
        font-size: 15px;
        color: #111827;
        font-weight: 900;
        margin: 4px 0 0;
    }

    .donation-recent-time {
        font-size: 12px;
        color: #6b7280;
        text-align: right;
        white-space: nowrap;
        line-height: 1.5;
    }

    .donation-recent-row {
        display: grid;
        grid-template-columns: 92px minmax(0, 1fr);
        gap: 10px;
        align-items: start;
        font-size: 13px;
        line-height: 1.6;
        padding: 5px 0;
        text-wrap-mode: nowrap;
    }

    .donation-recent-row span {
        color: #6b7280;
        font-weight: 700;
    }

    .donation-recent-row strong {
        color: #111827;
        font-weight: 900;
        text-align: right;
        word-break: break-word;
    }

    .donation-recent-row .donation-recent-green {
        color: #16a34a;
    }

    .donation-recent-empty {
        border: 1px dashed #d1d5db;
        border-radius: 16px;
        padding: 20px;
        text-align: center;
        color: #6b7280;
        background: #ffffff;
    }
}