/**
 * GPWeb Theme - Custom Styles
 * GiaiPhapWeb.com
 */

/* ============================================
   CRITICAL: Prevent Horizontal Overflow
   (Fixes content causing mobile horizontal scroll)
   ============================================ */
html, body {
    overflow-x: hidden !important;
    max-width: 100vw;
    width: 100%;
}

/* Prevent scrollbars from AOS animations and other content */
section,
main {
    overflow: clip !important;
}

/* Header - allow dropdown overflow but hide horizontal */
#header {
    overflow-x: clip !important;
    overflow-y: visible !important;
}

.container {
    overflow-x: clip !important;
}

/* Force all main containers to respect viewport width */
article {
    max-width: 100%;
    overflow-x: hidden;
}

/* Prose content - aggressive overflow handling */
.prose {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

.prose img,
.prose video,
.prose iframe,
.prose embed,
.prose object,
.prose table,
.prose pre,
.prose figure {
    max-width: 100% !important;
    height: auto;
}

.prose table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    /* Brand Colors */
    --color-sky: #0EA5E9;
    --color-emerald: #10B981;
    --color-orange: #F97316;
    --color-gold: #FACC15;
    --color-purple: #A855F7;
    
    /* Neutrals */
    --color-slate-900: #0F172A;
    --color-slate-600: #475569;
    --color-slate-200: #E2E8F0;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms ease;
}

/* ============================================
   GLOBAL STYLES
   ============================================ */
body {
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.font-brand {
    font-family: 'Be Vietnam Pro', sans-serif;
}

/* ============================================
   HEADER STYLES
   ============================================ */
.header-scrolled {
    box-shadow: var(--shadow-md);
    background-color: rgba(255, 255, 255, 0.98);
}

.nav-link {
    position: relative;
    font-weight: 600;
    color: #475569;
    transition: color 0.2s ease;
    padding: 0.5rem 0;
    white-space: nowrap;
}

.nav-link:hover {
    color: #0EA5E9;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #0EA5E9;
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link.active {
    color: #0EA5E9;
}

/* Dropdown menu animation */
.dropdown-menu {
    opacity: 0;
    visibility: hidden;
    transform: translateY(0.5rem);
    transition: all 0.2s ease;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ============================================
   MOBILE MENU STYLES
   ============================================ */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    background-color: white;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}

.mobile-menu.open {
    transform: translateX(0);
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   FORM STYLES
   ============================================ */
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #CBD5E1;
    border-radius: 0.75rem;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px #0EA5E9;
    border-color: transparent;
}

.form-input:hover {
    border-color: #94A3B8;
}

.form-input::placeholder {
    color: #94A3B8;
}

.form-input.error {
    border-color: #EF4444;
}

.form-input.error:focus {
    box-shadow: 0 0 0 2px #EF4444;
}

.form-error {
    color: #EF4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* ============================================
   BUTTON STYLES
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background-color: #0EA5E9;
    color: white;
}

.btn-primary:hover {
    background-color: #0284C7;
    box-shadow: 0 10px 15px -3px rgba(14, 165, 233, 0.3);
}

.btn-orange {
    background-color: #F97316;
    color: white;
}

.btn-orange:hover {
    background-color: #EA580C;
    box-shadow: 0 10px 15px -3px rgba(249, 115, 22, 0.3);
}

.btn-emerald {
    background-color: #10B981;
    color: white;
}

.btn-emerald:hover {
    background-color: #059669;
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.3);
}

.btn-purple {
    background-color: #A855F7;
    color: white;
}

.btn-purple:hover {
    background-color: #9333EA;
    box-shadow: 0 10px 15px -3px rgba(168, 85, 247, 0.3);
}

.btn-outline {
    border: 2px solid #CBD5E1;
    color: #475569;
    background: transparent;
}

.btn-outline:hover {
    border-color: #0EA5E9;
    color: #0EA5E9;
}

/* ============================================
   CARD STYLES
   ============================================ */
.card {
    background-color: white;
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid #E2E8F0;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-xl);
    border-color: #7DD3FC;
}

.card-orange:hover {
    border-color: #FDBA74;
}

.card-emerald:hover {
    border-color: #6EE7B7;
}

.card-purple:hover {
    border-color: #C4B5FD;
}

/* ============================================
   ANIMATION UTILITIES
   ============================================ */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

/* Stagger animation delays */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }

/* ============================================
   LOADING STATES
   ============================================ */
.skeleton {
    background-color: #E2E8F0;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    border-radius: 0.25rem;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading-spinner {
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid #E2E8F0;
    border-top-color: #0EA5E9;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   SCROLL BEHAVIOR
   ============================================ */
html {
    scroll-behavior: smooth;
}

/* Back to top button */
#back-to-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 40;
    width: 3rem;
    height: 3rem;
    background-color: #0EA5E9;
    color: white;
    border-radius: 50%;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(1rem);
    transition: all 0.3s ease;
}

#back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#back-to-top:hover {
    background-color: #0284C7;
    transform: translateY(-0.25rem);
    box-shadow: var(--shadow-xl);
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */
.container {
    max-width: 80rem;
    margin-left: auto;
    margin-right: auto;
}

/* Hide scrollbar but allow scrolling */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* ============================================
   SECTION DIVIDERS
   ============================================ */
.section-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #E2E8F0, transparent);
}

.section-divider-wave {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M321.39,56.44c58-10.79,114.16-30.13,172-41.86,82.39-16.72,168.19-17.73,250.45-.39C823.78,31,906.67,72,985.66,92.83c70.05,18.48,146.53,26.09,214.34,3V0H0V27.35A600.21,600.21,0,0,0,321.39,56.44Z' fill='%23f8fafc'/%3E%3C/svg%3E");
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    header,
    footer,
    .back-to-top,
    .mobile-menu {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
    }
}

/* ============================================
   FILTER TABS - Web Nhanh Template Gallery
   ============================================ */
.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    padding: 1rem;
    background: #f1f5f9;
    border-radius: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.filter-tab {
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 2px solid transparent;
    background: transparent;
    color: #64748b;
    text-decoration: none;
}

.filter-tab:hover {
    color: #0EA5E9;
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.filter-tab.active {
    background: white;
    color: #0EA5E9;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: #bae6fd;
}

/* Category Pills for subcategories */
.category-pill {
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 2px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    background: #fff7ed;
    color: #ea580c;
}

.category-pill:hover {
    background: #fed7aa;
}

.category-pill.active {
    background: #F97316;
    color: white;
}

/* ============================================
   STATUS BADGES (for product/service cards)
   ============================================ */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    line-height: 1;
    backdrop-filter: blur(4px);
}

.badge-featured {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #78350f;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.badge-hot {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
    animation: pulse-badge 2s ease-in-out infinite;
}

.badge-best-sale {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.badge-popular {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(139, 92, 246, 0.3);
}

.badge-on-sale {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(249, 115, 22, 0.3);
}

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

/* ============================================
   PRICING CARDS (Web Hãng)
   ============================================ */
.pricing-card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.pricing-card:hover {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    border-color: #bae6fd;
}

.pricing-card.featured {
    border-color: #0EA5E9;
    box-shadow: 0 25px 50px -12px rgba(14, 165, 233, 0.2);
    position: relative;
    transform: scale(1.02);
}

.pricing-card.featured::before {
    content: '⭐ Phổ biến nhất';
    position: absolute;
    top: -0.75rem;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #0EA5E9 0%, #0284c7 100%);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.375rem 1rem;
    border-radius: 9999px;
    white-space: nowrap;
}

/* ============================================
   ANIMATION: Float
   ============================================ */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* ============================================
   PROSE / ARTICLE CONTENT STYLES
   Enhanced typography for blog posts, articles
   Note: Overflow rules are in CRITICAL section at top
   ============================================ */
.prose {
    color: #334155;
    line-height: 1.8;
    font-size: 1.0625rem;
}

.prose p {
    margin-top: 1.25em;
    margin-bottom: 1.25em;
    text-align: justify;
}

.prose h1 {
    font-size: 2.25em;
    font-weight: 700;
    margin-top: 1.5em;
    margin-bottom: 0.75em;
    line-height: 1.2;
    color: #0f172a;
}

.prose h2 {
    font-size: 1.75em;
    font-weight: 600;
    margin-top: 1.75em;
    margin-bottom: 0.75em;
    line-height: 1.3;
    color: #0f172a;
    padding-bottom: 0.5em;
    border-bottom: 1px solid #e2e8f0;
}

.prose h3 {
    font-size: 1.375em;
    font-weight: 600;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    line-height: 1.4;
    color: #1e293b;
}

.prose h4 {
    font-size: 1.125em;
    font-weight: 600;
    margin-top: 1.25em;
    margin-bottom: 0.5em;
    color: #1e293b;
}

.prose strong,
.prose b {
    font-weight: 600;
    color: #1e293b;
}

.prose ul,
.prose ol {
    margin-top: 1.25em;
    margin-bottom: 1.25em;
    padding-left: 1.5em;
}

.prose ul {
    list-style-type: disc;
}

.prose ol {
    list-style-type: decimal;
}

.prose li {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

.prose li::marker {
    color: #0EA5E9;
}

.prose a {
    color: #0EA5E9;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s ease;
}

.prose a:hover {
    color: #0284c7;
}

.prose blockquote {
    margin-top: 1.5em;
    margin-bottom: 1.5em;
    padding-left: 1.25em;
    border-left: 4px solid #0EA5E9;
    font-style: italic;
    color: #475569;
    background-color: #f8fafc;
    padding: 1em 1.25em;
    border-radius: 0 0.5rem 0.5rem 0;
}

.prose img {
    margin-top: 1.5em;
    margin-bottom: 1.5em;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.prose pre {
    margin-top: 1.5em;
    margin-bottom: 1.5em;
    padding: 1em;
    background-color: #1e293b;
    border-radius: 0.5rem;
    overflow-x: auto;
}

.prose code {
    font-family: 'Fira Code', 'Monaco', monospace;
    font-size: 0.875em;
}

.prose :not(pre) > code {
    background-color: #f1f5f9;
    padding: 0.2em 0.4em;
    border-radius: 0.25rem;
    color: #e11d48;
}

.prose table {
    width: 100%;
    margin-top: 1.5em;
    margin-bottom: 1.5em;
    border-collapse: collapse;
}

.prose thead {
    background-color: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

.prose th {
    padding: 0.75em 1em;
    text-align: left;
    font-weight: 600;
    color: #1e293b;
}

.prose td {
    padding: 0.75em 1em;
    border-bottom: 1px solid #e2e8f0;
}

.prose tbody tr:hover {
    background-color: #f8fafc;
}

.prose hr {
    margin-top: 2em;
    margin-bottom: 2em;
    border: none;
    border-top: 1px solid #e2e8f0;
}

/* Prose size variants */
.prose-lg {
    font-size: 1.125rem;
}

.prose-lg p {
    margin-top: 1.5em;
    margin-bottom: 1.5em;
}

.prose-lg h2 {
    font-size: 1.875em;
}

.prose-lg h3 {
    font-size: 1.5em;
}

/* First paragraph - no top margin */
.prose > p:first-child {
    margin-top: 0;
}

/* Last element - no bottom margin */
.prose > *:last-child {
    margin-bottom: 0;
}
