/**
 * WHMCS Theme - Custom Styles
 * Author: WHMCS All-in-One
 */

/* =========================================
   ROOT VARIABLES
   ========================================= */
:root {
    --primary: #0d6efd;
    --primary-dark: #0a58ca;
    --secondary: #6c757d;
    --success: #198754;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #0dcaf0;
    --dark: #212529;
    --light: #f8f9fa;
    --gradient-primary: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    --gradient-dark: linear-gradient(135deg, #1a1d29 0%, #0f1117 100%);
    --shadow-sm: 0 2px 10px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 30px rgba(0,0,0,0.1);
    --shadow-lg: 0 20px 50px rgba(0,0,0,0.15);
    --border-radius: 15px;
    --border-radius-lg: 25px;
    --transition: all 0.3s ease;
}

/* =========================================
   GLOBAL STYLES
   ========================================= */
html, body {
    overflow-x: hidden;
}

body {
    font-family: 'Roboto', sans-serif;
    color: #333;
    position: relative;
}

/* Main Layout Container */
#main-content {
    max-width: 100%;
    overflow-x: hidden;
}

#main-content > section,
#main-content > div:not(.modal):not(.offcanvas) {
    max-width: 100%;
}

#main-content > section > .container,
#main-content > section > .container-fluid > .row,
#main-content > div > .container {
    max-width: 1320px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
}

/* Fix overflow on all sections */
section,
.container,
.row,
main,
header,
footer {
    max-width: 100%;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
}

.section-padding {
    padding: 80px 0;
}

/* =========================================
   PRELOADER
   ========================================= */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.loader {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =========================================
   TOP BAR
   ========================================= */
.top-bar {
    background: var(--gradient-dark);
    padding: 8px 0;
    font-size: 13px;
}

.top-bar > .container,
.main-header > nav > .container,
footer > .container {
    max-width: 1320px;
    margin-left: auto;
    margin-right: auto;
}

.top-bar a {
    color: rgba(255,255,255,0.8);
}

.top-bar a:hover {
    color: #fff;
}

.top-bar .social-links a {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    margin-left: 5px;
    transition: var(--transition);
}

.top-bar .social-links a:hover {
    background: var(--primary);
    transform: translateY(-2px);
}

/* =========================================
   NAVBAR
   ========================================= */
.navbar {
    padding: 15px 0;
    transition: var(--transition);
}

.navbar.scrolled {
    padding: 10px 0;
    box-shadow: var(--shadow-md);
}

.navbar-brand img {
    height: 45px;
    transition: var(--transition);
}

.navbar.scrolled .navbar-brand img {
    height: 40px;
}

.navbar .nav-link {
    font-weight: 500;
    padding: 10px 16px !important;
    color: #333;
    transition: var(--transition);
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: var(--primary);
}

.navbar .dropdown-menu {
    border: none;
    box-shadow: var(--shadow-md);
    border-radius: var(--border-radius);
    padding: 15px 0;
    min-width: 220px;
}

.navbar .dropdown-item {
    padding: 10px 20px;
    font-weight: 500;
    transition: var(--transition);
}

.navbar .dropdown-item:hover {
    background: var(--light);
    color: var(--primary);
    padding-left: 25px;
}

.navbar .dropdown-item i {
    width: 25px;
}

/* =========================================
   MEGA MENU (Step Technology style)
   ========================================= */
.mega-menu-dropdown {
    position: static !important;
}

.mega-menu-panel {
    width: 100%;
    left: 0;
    right: 0;
    border: none !important;
    box-shadow: 0 12px 40px rgba(0,0,0,0.12) !important;
    border-radius: 0 0 16px 16px !important;
    padding: 0 !important;
    margin-top: 0 !important;
    border-top: 3px solid var(--primary) !important;
}

.mega-menu-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    padding: 28px 20px;
}

.mega-menu-col {
    padding: 0 16px;
    border-right: 1px solid #f0f0f0;
}

.mega-menu-col:nth-child(4n) {
    border-right: none;
}

/* Khi có 8 nhóm → 2 hàng 4 cột */
.mega-menu-col:nth-child(n+5) {
    padding-top: 24px;
    border-top: 1px solid #f0f0f0;
}

.mega-menu-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 10px;
}

.mega-menu-group-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f7fa;
    border-radius: 10px;
    color: #555;
    font-size: 15px;
    flex-shrink: 0;
}

.mega-menu-group-title {
    font-weight: 700;
    font-size: 13px;
    color: #1a1a1a;
    letter-spacing: 0.5px;
}

.mega-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mega-menu-list li {
    margin-bottom: 2px;
}

.mega-menu-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    color: #555;
    font-size: 14px;
    font-weight: 400;
    text-decoration: none;
    transition: all 0.2s ease;
}

.mega-menu-link:hover {
    background: #f5f7fa;
    color: var(--primary);
    transform: translateX(2px);
}

.mega-menu-item-icon {
    width: 18px;
    text-align: center;
    color: #999;
    font-size: 13px;
    flex-shrink: 0;
}

.mega-menu-link:hover .mega-menu-item-icon {
    color: var(--primary);
}

/* Orange dot badge (hot/highlight) */
.mega-menu-badge {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #f37021;
    border-radius: 50%;
    margin-left: auto;
    flex-shrink: 0;
}

/* Hover animation cho dropdown - desktop only */
@media (min-width: 992px) {
    .mega-menu-dropdown .mega-menu-panel {
        display: block !important;
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
        transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
        pointer-events: none;
    }

    .mega-menu-dropdown:hover .mega-menu-panel,
    .mega-menu-dropdown .mega-menu-panel.show {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }

    /* Nav link active state for "Dịch vụ" dropdown trigger */
    .mega-menu-dropdown:hover > .nav-link {
        color: var(--primary);
    }
}

/* Responsive mega menu */
@media (max-width: 991.98px) {
    .mega-menu-panel {
        position: relative !important;
        box-shadow: none !important;
        border: none !important;
        border-top: none !important;
    }

    .mega-menu-grid {
        grid-template-columns: 1fr;
        padding: 10px;
        gap: 0;
    }

    .mega-menu-col {
        border-right: none;
        padding: 8px 0;
        border-bottom: 1px solid #f0f0f0;
    }

    .mega-menu-col:nth-child(n+5) {
        padding-top: 8px;
        border-top: none;
    }

    .mega-menu-col:last-child {
        border-bottom: none;
    }
}

/* =========================================
   HERO SECTION
   ========================================= */
.hero-section {
    background: var(--gradient-dark);
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('/layouts/Whmcs/images/hero-pattern.png') repeat;
    opacity: 0.1;
}

.hero-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    animation: float 15s infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) translateX(0); }
    25% { transform: translateY(-30px) translateX(30px); }
    50% { transform: translateY(-60px) translateX(-20px); }
    75% { transform: translateY(-30px) translateX(10px); }
}

.hero-wave {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    z-index: 1;
}

/* Domain Search Box */
.domain-search-box {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius-lg);
    padding: 25px;
    border: 1px solid rgba(255,255,255,0.2);
}

.domain-input-wrapper {
    background: #fff;
    border-radius: 50px;
    padding: 5px;
    display: flex;
    align-items: center;
}

.domain-input-wrapper input {
    border: none;
    padding: 15px 20px;
    font-size: 16px;
    flex: 1;
}

.domain-input-wrapper input:focus {
    outline: none;
}

.domain-input-wrapper .btn-search {
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
}

/* =========================================
   PRICING CARDS
   ========================================= */
.pricing-card {
    background: #fff;
    border-radius: var(--border-radius-lg);
    padding: 30px;
    position: relative;
    transition: var(--transition);
    border: 2px solid transparent;
}

.pricing-card:hover,
.pricing-card.featured {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.pricing-card.featured {
    border-color: var(--primary);
}

.pricing-card .featured-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 20px;
    border-radius: 20px;
}

.pricing-card .price {
    font-size: 2.5rem;
    font-weight: 700;
}

.pricing-card .price small {
    font-size: 1rem;
    font-weight: 400;
}

.pricing-card .feature-list {
    list-style: none;
    padding: 0;
}

.pricing-card .feature-list li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.pricing-card .feature-list li:last-child {
    border-bottom: none;
}

.pricing-card .feature-list li i {
    width: 20px;
    margin-right: 10px;
}

/* =========================================
   BUTTONS
   ========================================= */
.btn {
    padding: 12px 24px;
    font-weight: 600;
    border-radius: 50px;
    transition: var(--transition);
}

.btn-primary {
    background: var(--gradient-primary);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(13, 110, 253, 0.3);
}

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

.btn-lg {
    padding: 15px 30px;
}

/* =========================================
   FOOTER
   ========================================= */
footer {
    background: var(--gradient-dark);
}

footer h5 {
    font-size: 1.1rem;
    margin-bottom: 25px;
}

footer a {
    color: rgba(255,255,255,0.7);
}

footer a:hover {
    color: #fff;
    padding-left: 5px;
}

footer .text-white-50,
footer .hover-white {
    color: rgba(255,255,255,0.6) !important;
}

footer .hover-white:hover {
    color: #fff !important;
}

footer .payment-methods img {
    height: 30px;
    opacity: 0.7;
    transition: var(--transition);
}

footer .payment-methods img:hover {
    opacity: 1;
}

/* =========================================
   FLOATING CONTACT
   ========================================= */
.floating-contact {
    position: fixed;
    right: 20px;
    bottom: 100px;
    z-index: 999;
}

.floating-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    margin-bottom: 10px;
    color: #fff;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

.floating-btn:hover {
    transform: scale(1.1);
    color: #fff;
}

.floating-btn.phone {
    background: var(--success);
    animation: pulse 2s infinite;
}

.floating-btn.zalo {
    background: #0068ff;
}

.floating-btn.messenger {
    background: linear-gradient(135deg, #00b2ff 0%, #006aff 100%);
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(25, 135, 84, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(25, 135, 84, 0); }
    100% { box-shadow: 0 0 0 0 rgba(25, 135, 84, 0); }
}

/* =========================================
   BACK TO TOP
   ========================================= */
.back-to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 45px;
    height: 45px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 998;
    transition: var(--transition);
    cursor: pointer;
    border: none;
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
}

.back-to-top.show {
    display: flex;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 991.98px) {
    .navbar .nav-link {
        padding: 12px 0 !important;
        border-bottom: 1px solid #eee;
    }

    .navbar .dropdown-menu {
        box-shadow: none;
        padding: 0;
        margin-left: 20px;
    }

    .hero-section {
        min-height: auto;
        padding: 80px 0 60px;
    }
}

@media (max-width: 767.98px) {
    body {
        overflow-x: hidden;
    }

    .display-4 {
        font-size: 1.75rem;
    }

    .display-5 {
        font-size: 1.5rem;
    }

    .display-6 {
        font-size: 1.25rem;
    }

    .section-padding {
        padding: 50px 0;
    }

    .pricing-card {
        padding: 20px;
    }

    .hero-section {
        padding: 60px 0 40px;
    }

    .hero-section .lead {
        font-size: 1rem;
    }

    .hero-section .btn-lg {
        padding: 10px 20px;
        font-size: 14px;
    }

    .domain-search-box {
        padding: 20px !important;
    }

    .domain-search-box .input-group {
        flex-wrap: wrap;
    }

    .domain-search-box .form-control {
        border-radius: 8px !important;
        margin-bottom: 10px;
    }

    .domain-search-box .form-select {
        max-width: 100% !important;
        border-radius: 8px !important;
        margin-bottom: 10px;
    }

    .domain-search-box .btn {
        width: 100%;
        border-radius: 8px !important;
    }

    .stat-item h3 {
        font-size: 1.25rem;
    }

    .tld-prices .row {
        gap: 5px 0;
    }
}

/* =========================================
   UTILITY CLASSES
   ========================================= */
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-primary {
    background: var(--gradient-primary);
}

.bg-gradient-dark {
    background: var(--gradient-dark);
}

.rounded-lg {
    border-radius: var(--border-radius);
}

.rounded-xl {
    border-radius: var(--border-radius-lg);
}

.shadow-custom {
    box-shadow: var(--shadow-md);
}

.hover-lift {
    transition: var(--transition);
}

.hover-lift:hover {
    transform: translateY(-5px);
}
