/* Global Variables & Theme */
:root {
    --primary-color: #ff6584;
    --primary-hover: #ff476d;
    --bg-gradient: linear-gradient(135deg, #f7f3f6 0%, #fff0f5 50%, #ffe5ed 100%);
    --card-bg: rgba(255, 255, 255, 0.55);
    --card-shadow: 0 8px 32px 0 rgba(255, 101, 132, 0.04);
    --card-shadow-hover: 0 8px 32px 0 rgba(255, 101, 132, 0.12);
    --text-color: #5d4f55;
    --text-muted: #8d7e84;
    --header-bg: rgba(255, 255, 255, 0.55);
    --border-color: rgba(255, 255, 255, 0.45);
    
    /* Diện tích & Khoảng cách chiều rộng căn lề chung */
    --content-width: 90%;
    --content-max-width: 1200px;
    
    /* Neon Glow Glows */
    --neon-pink: 0 0 15px rgba(255, 101, 132, 0.35), 0 0 30px rgba(255, 101, 132, 0.15);
    --neon-purple: 0 0 15px rgba(184, 98, 255, 0.35), 0 0 30px rgba(184, 98, 255, 0.15);
    --neon-orange: 0 0 15px rgba(255, 145, 77, 0.35), 0 0 30px rgba(255, 145, 77, 0.15);
    --neon-green: 0 0 15px rgba(46, 196, 182, 0.35), 0 0 30px rgba(46, 196, 182, 0.15);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', 'Nunito', sans-serif;
    color: var(--text-color);
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* --- WELCOME HERO SCREEN --- */
.portal-welcome-hero {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background: linear-gradient(135deg, #eef7ff 0%, #f6f0ff 50%, #ffeef3 100%);
    z-index: 9999;
    transition: opacity 1.2s cubic-bezier(0.7, 0, 0.3, 1), transform 1.2s cubic-bezier(0.7, 0, 0.3, 1);
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.portal-welcome-hero.fade-out-welcome {
    opacity: 0;
    transform: scale(1.06);
    pointer-events: none;
}

/* Mesh Gradient Animated Circles */
.welcome-mesh-circles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.mesh-circle {
    position: absolute;
    border-radius: 50%;
    mix-blend-mode: multiply;
    filter: blur(100px);
    opacity: 0.45;
}

.circle-1 {
    width: 45vw;
    height: 45vw;
    top: -10vw;
    left: -10vw;
    background: radial-gradient(circle, rgba(255,101,132,0.4) 0%, rgba(255,255,255,0) 70%);
    animation: moveCircle1 25s infinite alternate ease-in-out;
}

.circle-2 {
    width: 50vw;
    height: 50vw;
    bottom: -15vw;
    right: -10vw;
    background: radial-gradient(circle, rgba(184,98,255,0.3) 0%, rgba(255,255,255,0) 70%);
    animation: moveCircle2 30s infinite alternate ease-in-out;
}

.circle-3 {
    width: 40vw;
    height: 40vw;
    top: 25%;
    left: 30%;
    background: radial-gradient(circle, rgba(255,182,193,0.35) 0%, rgba(255,255,255,0) 70%);
    animation: moveCircle3 20s infinite alternate ease-in-out;
}

@keyframes moveCircle1 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(10vw, 8vw) scale(1.15); }
}

@keyframes moveCircle2 {
    0% { transform: translate(0, 0) scale(1.1); }
    100% { transform: translate(-12vw, -8vw) scale(0.9); }
}

@keyframes moveCircle3 {
    0% { transform: translate(0, 0) scale(0.9); }
    100% { transform: translate(-5vw, 10vw) scale(1.2); }
}

/* Welcome content */
.welcome-content {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 0 20px;
    max-width: 800px;
}

.welcome-title {
    font-family: 'Outfit', sans-serif;
    font-size: 85px;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -1px;
    margin-bottom: 25px;
    text-shadow: 0 0 20px rgba(255, 101, 132, 0.4), 
                 0 0 40px rgba(255, 101, 132, 0.2), 
                 0 0 60px rgba(255, 101, 132, 0.1);
    animation: welcomeTitleGlow 3s infinite alternate ease-in-out;
}

@keyframes welcomeTitleGlow {
    0% {
        text-shadow: 0 0 15px rgba(255, 101, 132, 0.35), 
                     0 0 30px rgba(255, 101, 132, 0.15);
        transform: scale(1);
    }
    100% {
        text-shadow: 0 0 30px rgba(255, 101, 132, 0.6), 
                     0 0 60px rgba(255, 101, 132, 0.3),
                     0 0 90px rgba(255, 101, 132, 0.15);
        transform: scale(1.02);
    }
}

.welcome-subtitle {
    font-family: 'Outfit', sans-serif;
    font-size: 21px;
    color: #7d6e74;
    font-weight: 400;
    letter-spacing: 0.5px;
    line-height: 1.6;
    min-height: 2.2em; /* Reserve height to avoid visual layout shifts while typing */
}

/* Header Styling (Floating Glass Island) */
.portal-header {
    position: sticky;
    top: 20px;
    z-index: 1000;
    margin: 0 auto;
    width: var(--content-width);
    max-width: var(--content-max-width);
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(255, 101, 132, 0.04),
                inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Scrolled state for the floating header */
.portal-header.scrolled {
    top: 8px;
    width: var(--content-width);
    max-width: var(--content-max-width);
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(255, 255, 255, 0.85);
    box-shadow: 0 12px 25px rgba(255, 101, 132, 0.08);
}

.header-container {
    width: 100%;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.04);
}

.logo-icon {
    font-size: 24px;
    color: var(--primary-color);
    filter: drop-shadow(0 2px 5px rgba(255, 101, 132, 0.25));
    animation: pulseLogo 1.5s infinite ease-in-out;
}

@keyframes pulseLogo {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.12); }
}

.logo-text {
    font-family: 'Dancing Script', cursive;
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    text-shadow: 0 2px 4px rgba(255, 101, 132, 0.05);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
}

/* Search Bar */
.search-bar-container {
    position: relative;
    width: 200px;
    flex-shrink: 0;
}

.search-bar-container input {
    width: 100%;
    padding: 9px 15px 9px 36px;
    border-radius: 30px;
    border: 1px solid rgba(255, 101, 132, 0.2);
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    outline: none;
    font-family: inherit;
    font-size: 13.5px;
    color: var(--text-color);
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.01);
}

.search-bar-container input:focus {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 12px rgba(255, 101, 132, 0.15), inset 0 2px 4px rgba(0, 0, 0, 0.01);
}

.search-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-color); /* Trực tiếp dùng màu tối của text/dropdown icon */
    font-size: 13.5px;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 2; /* Đảm bảo icon nằm đè lên trên nền background của input */
}

/* Sáng rực tông hồng thương hiệu khi ô tìm kiếm được chọn */
.search-bar-container:focus-within .search-icon {
    color: var(--primary-color);
}

/* Buttons */
.btn-support {
    background: linear-gradient(135deg, #d396ff 0%, #b862ff 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 600;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 15px rgba(184, 98, 255, 0.25);
    transition: all 0.3s ease;
}

.btn-support:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(184, 98, 255, 0.4);
}

/* Dropdown Menu */
.dropdown-menu {
    position: relative;
    display: inline-block;
}

.btn-dropdown {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 101, 132, 0.2);
    color: var(--text-color);
    padding: 9px 18px;
    border-radius: 30px;
    font-weight: 600;
    font-family: inherit;
    font-size: 13.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.btn-dropdown:hover {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(255, 101, 132, 0.5);
}

.dropdown-content {
    position: absolute;
    right: 0;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    min-width: 160px;
    box-shadow: 0 12px 35px rgba(255, 101, 132, 0.1);
    border-radius: 14px;
    padding: 6px;
    z-index: 150;
    margin-top: 6px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    
    /* Smooth sliding animation properties */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.95);
    transform-origin: top right;
    transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1),
                opacity 0.3s cubic-bezier(0.165, 0.84, 0.44, 1),
                visibility 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    pointer-events: none;
}

.dropdown-content.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.dropdown-content a {
    color: var(--text-color);
    padding: 9px 14px;
    text-decoration: none;
    display: block;
    font-size: 13.5px;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.dropdown-content a:hover {
    background-color: rgba(255, 101, 132, 0.08);
    color: var(--primary-color);
}

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

/* Main Container */
.portal-main {
    flex: 1;
    padding: 45px 0px 0px 0px;
}

.main-container {
    width: var(--content-width);
    max-width: var(--content-max-width);
    margin: 0 auto;
}

/* Sections */
.portal-section {
    margin-bottom: 50px;
}

.section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #4a3e43;
    display: flex;
    align-items: center;
    gap: 10px;
}

.popular-title-icon {
    color: #ff914d;
}

.all-title-icon {
    color: var(--primary-color);
}

/* Templates Grid & Cards */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

/* Popular Carousel Layout */
.popular-carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.popular-scroll-container {
    display: flex;
    gap: 20px;
    overflow-x: hidden;
    scroll-behavior: smooth;
    width: 100%;
    scrollbar-width: none; /* Firefox */
}

.popular-scroll-container::-webkit-scrollbar {
    display: none; /* Safari and Chrome */
}

.popular-scroll-container .template-card {
    flex: 0 0 280px; /* Cố định chiều rộng thẻ trong Carousel */
}


.template-card {
    background: var(--card-bg);
    border-radius: 24px;
    border: 1.5px solid var(--border-color);
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--card-shadow);
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Custom Neon Glow on Hover */
.template-card:hover {
    transform: translateY(-8px);
    border-color: rgba(255, 255, 255, 0.65);
}

.template-card[data-id="valentine"]:hover {
    box-shadow: 0 15px 35px rgba(255, 101, 132, 0.2), var(--neon-pink);
}

.template-card[data-id*="happy-birthday"]:hover {
    box-shadow: 0 15px 35px rgba(255, 101, 132, 0.2), var(--neon-pink);
}

.template-card[data-id="galaxylove"]:hover {
    box-shadow: 0 15px 35px rgba(184, 98, 255, 0.2), var(--neon-purple);
}

.template-card[data-id="myheart"]:hover {
    box-shadow: 0 15px 35px rgba(255, 101, 132, 0.2), var(--neon-pink);
}

.template-card[data-id="happy-new-year"]:hover {
    box-shadow: 0 15px 35px rgba(255, 145, 77, 0.2), var(--neon-orange);
}

.card-img-container {
    position: relative;
    width: 100%;
    height: 160px;
    overflow: hidden;
    background: #f7ecef;
    border-bottom: 1.5px solid var(--border-color);
}

.card-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.template-card:hover .card-img-container img {
    transform: scale(1.06);
}

.card-hover-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1; /* Luôn hiển thị video demo trực tiếp */
    pointer-events: none;
    z-index: 1;
}

.card-views-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 2;
    pointer-events: none;
}

.card-custom-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, #ff6584, #ff8da1);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 4px 10px rgba(255, 101, 132, 0.35);
    animation: badgePulse 2s infinite ease-in-out;
    pointer-events: none;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    align-items: center;
    text-align: center;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #4a3e43;
}

.card-desc {
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 15px;
    flex: 1;
}

.card-meta {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-top: 10px;
    border-top: 1px dashed rgba(255, 105, 180, 0.2);
}

.card-price {
    font-size: 14px;
    font-weight: 700;
    color: #27ae60;
    background: rgba(39, 174, 96, 0.08);
    padding: 4px 10px;
    border-radius: 12px;
}

.card-price.premium {
    color: #e67e22;
    background: rgba(230, 126, 34, 0.08);
}

.card-author {
    font-size: 12px;
    color: var(--text-muted);
}

.btn-card-open {
    width: 100%;
    background: #ffcbd7;
    color: #b5475e;
    border: none;
    padding: 12px;
    border-radius: 14px;
    font-weight: 700;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.template-card:hover .btn-card-open {
    background: var(--primary-color);
    color: white;
}

.btn-card-open:active {
    transform: scale(0.98);
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.page-num {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
}

.page-num.active, .page-num:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(255, 101, 132, 0.2);
}

.page-num:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.4);
    color: #bbb;
    border-color: var(--border-color);
    box-shadow: none;
    pointer-events: none;
}

/* Footer */
.portal-footer {
    text-align: center;
    padding: 25px 0;
    font-size: 13.5px;
    color: var(--text-muted);
    border-top: 1.5px solid var(--border-color);
    background: rgba(255, 255, 255, 0.4);
    font-weight: 700;
}

/* Floater Wrapper */
.free-website-floater-wrapper {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 15px;
}

/* Main Floater Button */
.free-website-floater {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.floater-badge {
    background: #ff6584;
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(255, 101, 132, 0.25);
    white-space: nowrap;
    opacity: 0.9;
    transition: all 0.3s ease;
}

.floater-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #2a2a2a;
    border: 2px solid white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 18px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.free-website-floater:hover .floater-avatar {
    transform: rotate(15deg) scale(1.08);
}

.free-website-floater-wrapper.active .floater-avatar {
    transform: rotate(180deg);
    background: var(--primary-color);
}

/* Sub Menu Container */
.floater-sub-menu {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.8);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.free-website-floater-wrapper.active .floater-sub-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

/* Sub Menu Item */
.floater-sub-item {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.floater-sub-item:hover {
    transform: translateX(-5px);
}

.sub-item-label {
    background: white;
    color: var(--text-color);
    font-weight: 700;
    font-size: 12px;
    padding: 6px 14px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1.5px solid var(--border-color);
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}

.floater-sub-item:hover .sub-item-label {
    opacity: 1;
    transform: translateX(0);
}

.sub-item-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 18px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

/* Sub Item Color Variants */
.floater-sub-item.zalo .sub-item-icon {
    background: linear-gradient(135deg, #0084ff, #0056b3);
}
.floater-sub-item.facebook .sub-item-icon {
    background: linear-gradient(135deg, #1877f2, #0d52b5);
}
.floater-sub-item.tiktok .sub-item-icon {
    background: linear-gradient(135deg, #010101, #333333);
}
.floater-sub-item.youtube .sub-item-icon {
    background: linear-gradient(135deg, #ff0000, #b30000);
}

/* Staggered animation delays for sub-items */
.free-website-floater-wrapper.active .floater-sub-item:nth-child(1) {
    transition-delay: 0.15s;
}
.free-website-floater-wrapper.active .floater-sub-item:nth-child(2) {
    transition-delay: 0.1s;
}
.free-website-floater-wrapper.active .floater-sub-item:nth-child(3) {
    transition-delay: 0.05s;
}
.free-website-floater-wrapper.active .floater-sub-item:nth-child(4) {
    transition-delay: 0s;
}



/* Modal Overlay & Card styling */
.portal-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(93, 79, 85, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

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

.portal-modal-card {
    background: white;
    border-radius: 24px;
    padding: 35px 25px;
    width: 90%;
    max-width: 440px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.8);
    position: relative;
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.15);
    text-align: center;
}

.portal-modal-overlay.active .portal-modal-card {
    transform: scale(1);
}

.btn-close-portal-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    color: #bbb;
    cursor: pointer;
    transition: color 0.2s ease;
}

.btn-close-portal-modal:hover {
    color: var(--primary-color);
}

/* Modal Content details */
.modal-body-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-template-title {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 800;
    color: #4a3e43;
}

.modal-template-desc {
    font-size: 14.5px;
    color: var(--text-color);
    line-height: 1.5;
    margin: 5px 0;
}

.modal-meta {
    background: #fff5f7;
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 14px;
    display: inline-flex;
    gap: 6px;
    border: 1px solid rgba(255, 105, 180, 0.12);
}

.meta-label {
    font-weight: 700;
    color: var(--primary-color);
}

.meta-val {
    color: var(--text-color);
}

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

.modal-btn-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    margin-top: 15px;
}

.btn-modal-action {
    text-decoration: none;
    padding: 11px 16px;
    border-radius: 12px;
    font-weight: 700;
    font-family: inherit;
    font-size: 13.5px;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

#modal-btn-customize {
    grid-column: span 2;
    order: -1;
}

.btn-green {
    background: #2ec4b6;
    color: white;
    box-shadow: 0 4px 15px rgba(46, 196, 182, 0.25);
}

.btn-green:hover {
    background: #25a195;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 196, 182, 0.35);
}

.btn-red {
    background: #ff5a5f;
    color: white;
    box-shadow: 0 4px 15px rgba(255, 90, 95, 0.25);
}

.btn-red:hover {
    background: #e04e52;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 90, 95, 0.35);
}

.btn-pink {
    background: #ff6584;
    color: white;
    box-shadow: 0 4px 15px rgba(255, 101, 132, 0.25);
}

.btn-pink:hover {
    background: #e04768;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 101, 132, 0.35);
}

.btn-gray {
    background: #eaeaea;
    color: #555;
}

.btn-gray:hover {
    background: #ddd;
    transform: translateY(-2px);
}

/* Donation custom layouts */
.banking-wrapper {
    margin: 10px 0;
    border-radius: 20px;
    overflow: hidden;
    border: 1.5px solid rgba(255, 101, 132, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
    max-width: 220px;
    width: 100%;
    background: #fff;
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.banking-qr-img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    display: block;
    transition: transform 0.3s ease;
}

.banking-wrapper:hover .banking-qr-img {
    transform: scale(1.03);
}

.support-contact-group {
    display: flex;
    gap: 12px;
    width: 100%;
    margin-top: 10px;
}

.contact-link {
    flex: 1;
    padding: 12px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.contact-link.zalo {
    background: linear-gradient(135deg, #0084ff, #0056b3);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 132, 255, 0.25);
}

.contact-link.facebook {
    background: linear-gradient(135deg, #1877f2, #0d52b5);
    color: white;
    box-shadow: 0 4px 15px rgba(24, 119, 242, 0.25);
}

.contact-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.text-center {
    text-align: center;
}

.text-sm {
    font-size: 12px !important;
}

.w-100 {
    width: 100% !important;
}

.heart-pulse {
    display: inline-block;
    animation: pulseLogo 1.2s infinite ease-in-out;
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .btn-text-desktop {
        display: none !important;
    }
    .btn-dropdown .dropdown-arrow {
        display: none !important;
    }
    .btn-dropdown, .btn-support {
        padding: 0 !important;
        width: 38px !important;
        height: 38px !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
        font-size: 15px !important;
        gap: 0 !important;
    }
    .btn-dropdown i, .btn-support i {
        margin: 0 !important;
    }
    .header-actions {
        gap: 8px !important;
    }
    .search-bar-container {
        flex: 1 !important;
        width: auto !important;
        max-width: 150px !important;
        min-width: 75px !important;
    }
    .search-bar-container input {
        padding: 8px 12px 8px 30px !important;
        font-size: 13px !important;
    }
    .search-bar-container .search-icon {
        left: 10px !important;
        font-size: 12px !important;
    }
    .portal-header {
        width: 95% !important;
        top: 8px !important;
    }
    .portal-header.scrolled {
        width: 95% !important;
        top: 5px !important;
    }
    .header-container {
        height: 52px !important;
        padding: 0 12px !important;
    }
    .logo-text {
        font-size: 20px !important;
    }
    .portal-main {
        padding: 20px 0 !important;
    }

    /* Popular Carousel Cards Mobile Resizing (Hiển thị đúng 2 card cạnh nhau) */
    .popular-scroll-container {
        gap: 12px !important;
    }
    .popular-scroll-container .template-card {
        flex: 0 0 calc(50% - 6px) !important; /* Hiển thị chính xác 2 card song song */
        border-radius: 16px !important;
    }
    .popular-scroll-container .card-img-container {
        height: 95px !important;
    }
    .popular-scroll-container .card-content {
        padding: 8px 6px !important;
    }
    .popular-scroll-container .card-title {
        font-size: 13px !important;
        font-weight: 700 !important;
    }
    .popular-scroll-container .card-desc {
        font-size: 11px !important;
        margin: 3px 0 !important;
        line-height: 1.3 !important;
    }
    .popular-scroll-container .card-meta {
        font-size: 10px !important;
        margin-bottom: 6px !important;
        gap: 4px !important;
    }
    .popular-scroll-container .btn-card-open {
        padding: 6px !important;
        font-size: 11.5px !important;
        border-radius: 8px !important;
    }
    .popular-scroll-container .card-views-badge {
        padding: 3px 8px !important;
        font-size: 9px !important;
        bottom: 6px !important;
        right: 6px !important;
    }

    /* All templates grid (Tất cả mẫu - giữ nguyên như cũ) */
    .templates-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
        gap: 20px !important;
    }
    .templates-grid .card-img-container {
        height: 120px !important;
    }
    .page-num {
        width: 32px !important;
        height: 32px !important;
        font-size: 13px !important;
    }
}
