/* ===== Blog HostCM - Main Stylesheet ===== */
:root {
    --primary: #0066ff;
    --primary-dark: #0052cc;
    --secondary: #6c5ce7;
    --accent: #00cec9;
    --success: #00b894;
    --warning: #fdcb6e;
    --danger: #d63031;
    --dark: #1a1a2e;
    --dark-light: #16213e;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --white: #ffffff;
    --shadow: 0 2px 15px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--gray-700);
    background: var(--gray-100);
    line-height: 1.7;
    font-size: 15px;
}

a { text-decoration: none; color: var(--primary); transition: var(--transition); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; }

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

/* ===== HEADER ===== */
.header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    min-height: 60px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--dark);
    white-space: nowrap;
    padding: 10px 0;
}
.logo span { color: var(--primary); }

/* --- Main nav --- */
.nav { display: flex; align-items: center; gap: 0; }
.nav > a:not(.btn-client-area),
.nav-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 20px 15px;
    color: var(--gray-700);
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
    white-space: nowrap;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    position: relative;
}
.nav > a:not(.btn-client-area):hover,
.nav-dropdown-toggle:hover,
.nav-dropdown.open > .nav-dropdown-toggle,
.nav-dropdown:hover > .nav-dropdown-toggle {
    color: var(--primary);
}
/* Underline active indicator */
.nav > a:not(.btn-client-area)::after,
.nav-dropdown-toggle::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 15px;
    right: 15px;
    height: 3px;
    background: var(--primary);
    border-radius: 3px 3px 0 0;
    transform: scaleX(0);
    transition: transform 0.25s ease;
}
.nav > a:not(.btn-client-area):hover::after,
.nav-dropdown:hover > .nav-dropdown-toggle::after,
.nav-dropdown.open > .nav-dropdown-toggle::after {
    transform: scaleX(1);
}
.nav-dropdown-toggle i.fa-chevron-down { font-size: 9px; transition: transform 0.25s ease; opacity: 0.5; }
.nav-dropdown:hover > .nav-dropdown-toggle i.fa-chevron-down,
.nav-dropdown.open > .nav-dropdown-toggle i.fa-chevron-down { transform: rotate(180deg); opacity: 1; }

/* --- Dropdown (opens on hover OR click) --- */
.nav-dropdown { position: relative; }
.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 250px;
    background: var(--white);
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: 0 10px 35px rgba(0,0,0,0.13);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 1001;
    border-top: 3px solid var(--primary);
    pointer-events: none;
}
/* Show on hover (desktop) */
.nav-dropdown:hover > .nav-dropdown-menu,
.nav-dropdown.open > .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}
.nav-dropdown-menu a {
    display: block;
    padding: 12px 20px;
    color: var(--gray-700);
    font-size: 13.5px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s, padding-left 0.2s;
    border-bottom: 1px solid var(--gray-100);
}
.nav-dropdown-menu a:last-child { border-bottom: none; }
.nav-dropdown-menu a:hover {
    background: var(--gray-100);
    color: var(--primary);
    padding-left: 26px;
}

/* --- Client area button (distinct, rounded) --- */
.btn-client-area {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 26px !important;
    margin-left: 15px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
    color: var(--white) !important;
    border-radius: 50px;
    font-weight: 700 !important;
    font-size: 13.5px !important;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0, 102, 255, 0.35);
    letter-spacing: 0.3px;
    text-transform: none;
}
.btn-client-area:hover {
    background: linear-gradient(135deg, var(--primary-dark), #003d99) !important;
    color: var(--white) !important;
    box-shadow: 0 6px 20px rgba(0, 102, 255, 0.5);
    transform: translateY(-1px);
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--dark);
}

/* ===== HERO ===== */
.hero {
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-light) 50%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(0,102,255,0.15) 0%, transparent 70%);
    animation: pulse 8s infinite;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}
.hero h1 {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 15px;
    position: relative;
}
.hero p {
    font-size: 1.2rem;
    opacity: 0.85;
    max-width: 700px;
    margin: 0 auto 30px;
    position: relative;
}
.hero-search {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    position: relative;
}
.hero-search input {
    width: 100%;
    padding: 15px 25px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    outline: none;
    box-shadow: var(--shadow-lg);
}
.hero-search button {
    position: absolute;
    right: 5px;
    top: 5px;
    bottom: 5px;
    padding: 0 25px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.hero-search button:hover { background: var(--primary-dark); }

/* ===== CATEGORIES BAR ===== */
.categories-bar {
    background: var(--white);
    padding: 20px 0;
    border-bottom: 1px solid var(--gray-200);
    overflow-x: auto;
}
.categories-list {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}
.cat-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border-radius: 25px;
    background: var(--gray-100);
    color: var(--gray-700);
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
    white-space: nowrap;
}
.cat-badge:hover, .cat-badge.active {
    background: var(--primary);
    color: var(--white);
}
.cat-badge i { font-size: 14px; }
.cat-count {
    background: rgba(0,0,0,0.1);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
}

/* ===== ARTICLE CARDS ===== */
.section { padding: 50px 0; }
.section-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-title i { color: var(--primary); }

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 25px;
}

.article-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}
.article-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}
.card-image {
    height: 200px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.card-image .placeholder-icon {
    font-size: 3rem;
    color: rgba(255,255,255,0.6);
}
.card-category {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 5px 12px;
    border-radius: 20px;
    background: rgba(0,0,0,0.5);
    color: var(--white);
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(5px);
}
.card-featured {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 5px 10px;
    border-radius: 20px;
    background: var(--warning);
    color: var(--dark);
    font-size: 11px;
    font-weight: 700;
}
.card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.card-body h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-body h3 a { color: inherit; }
.card-body h3 a:hover { color: var(--primary); }
.card-excerpt {
    color: var(--gray-600);
    font-size: 14px;
    margin-bottom: 15px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--gray-500);
    padding-top: 15px;
    border-top: 1px solid var(--gray-200);
}
.card-meta i { margin-right: 4px; }

/* ===== SINGLE ARTICLE ===== */
.article-header {
    background: linear-gradient(135deg, var(--dark) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 60px 0;
    text-align: center;
}
.article-header .breadcrumb {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    opacity: 0.8;
}
.article-header .breadcrumb a { color: var(--accent); }
.article-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    max-width: 800px;
    margin: 0 auto 20px;
    line-height: 1.3;
}
.article-meta-top {
    display: flex;
    justify-content: center;
    gap: 25px;
    font-size: 14px;
    opacity: 0.8;
}
.article-meta-top i { margin-right: 5px; }

.article-content {
    max-width: 850px;
    margin: -30px auto 50px;
    background: var(--white);
    border-radius: var(--radius);
    padding: 40px 50px;
    box-shadow: var(--shadow-lg);
    line-height: 1.9;
    font-size: 16px;
}
.article-content h2 {
    font-size: 1.6rem;
    color: var(--dark);
    margin: 35px 0 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--gray-200);
}
.article-content h3 {
    font-size: 1.3rem;
    color: var(--dark);
    margin: 25px 0 12px;
}
.article-content p { margin-bottom: 15px; }
.article-content ul, .article-content ol {
    margin: 15px 0;
    padding-left: 25px;
}
.article-content li { margin-bottom: 8px; }
.article-content img {
    border-radius: var(--radius-sm);
    margin: 20px 0;
    box-shadow: var(--shadow);
}
.article-content code {
    background: var(--gray-100);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 14px;
    color: var(--danger);
}
.article-content pre {
    background: var(--dark);
    color: #e0e0e0;
    padding: 20px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 20px 0;
}
.article-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}
.article-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 15px 20px;
    margin: 20px 0;
    background: var(--gray-100);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
}
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}
.article-content th, .article-content td {
    padding: 12px 15px;
    border: 1px solid var(--gray-300);
    text-align: left;
}
.article-content th {
    background: var(--gray-100);
    font-weight: 700;
}

.article-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid var(--gray-200);
}
.tag-link {
    padding: 5px 14px;
    background: var(--gray-100);
    border-radius: 20px;
    font-size: 13px;
    color: var(--gray-600);
    font-weight: 500;
}
.tag-link:hover { background: var(--primary); color: var(--white); }

/* ===== SIDEBAR ===== */
.blog-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
    padding: 50px 0;
}
.sidebar-widget {
    background: var(--white);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
    margin-bottom: 25px;
}
.sidebar-widget h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
}
.sidebar-list { list-style: none; }
.sidebar-list li { padding: 8px 0; border-bottom: 1px solid var(--gray-200); }
.sidebar-list li:last-child { border: none; }
.sidebar-list a { color: var(--gray-700); font-size: 14px; display: flex; justify-content: space-between; }
.sidebar-list a:hover { color: var(--primary); }

/* ===== COMMENTS ===== */
.comments-section {
    max-width: 850px;
    margin: 0 auto 50px;
}
.comment {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: var(--shadow);
}
.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}
.comment-author { font-weight: 700; color: var(--dark); }
.comment-date { font-size: 13px; color: var(--gray-500); }
.comment-form textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}
.comment-form textarea:focus { border-color: var(--primary); }

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 40px;
}
.pagination a, .pagination span {
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--gray-700);
    font-weight: 600;
    font-size: 14px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}
.pagination a:hover, .pagination .active {
    background: var(--primary);
    color: var(--white);
}

/* ===== FOOTER ===== */
.footer {
    background: var(--dark);
    color: rgba(255,255,255,0.7);
    padding: 50px 0 20px;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}
.footer h4 {
    color: var(--white);
    font-size: 1.1rem;
    margin-bottom: 20px;
}
.footer a { color: rgba(255,255,255,0.6); font-size: 14px; }
.footer a:hover { color: var(--white); }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 10px; }
.footer-links i { margin-right: 8px; width: 16px; }
.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 13px;
}

/* ===== FORMS ===== */
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 14px;
    color: var(--gray-700);
}
.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}
.form-control:focus { border-color: var(--primary); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: var(--white); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-secondary { background: var(--gray-600); color: var(--white); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 32px; font-size: 16px; }

.alert {
    padding: 15px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* ===== INFO BOXES ===== */
.info-box {
    padding: 20px;
    border-radius: var(--radius-sm);
    margin: 20px 0;
    border-left: 4px solid;
}
.info-box.tip { background: #e8f5e9; border-color: var(--success); }
.info-box.warning { background: #fff8e1; border-color: var(--warning); }
.info-box.important { background: #e3f2fd; border-color: var(--primary); }

/* ===== AD SLOTS ===== */
.ad-slot {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
}
.ad-slot:empty { display: none; }
.ad-item {
    text-align: center;
    line-height: 0;
}
.ad-item img {
    max-width: 100%;
    height: auto;
    border-radius: 0;
    display: block;
    margin: 0 auto;
}
/* Full-width banner positions */
.ad-header_below {
    background: var(--gray-100);
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-200);
}
.ad-header_below .ad-item img { max-height: 120px; }
.ad-hero_below {
    padding: 15px 20px;
    max-width: 1200px;
    margin: 0 auto;
}
.ad-hero_below .ad-item img { max-height: 150px; border-radius: var(--radius-sm); }
/* In-content positions */
.ad-articles_before,
.ad-articles_middle,
.ad-articles_after {
    padding: 15px 0;
    max-width: 1200px;
    margin: 0 auto;
}
.ad-articles_before .ad-item img,
.ad-articles_middle .ad-item img,
.ad-articles_after .ad-item img { max-height: 130px; border-radius: var(--radius-sm); }
/* Article content positions */
.ad-article_top,
.ad-article_middle,
.ad-article_bottom {
    padding: 15px 0;
    margin: 15px 0;
    border-top: 1px solid var(--gray-200);
    border-bottom: 1px solid var(--gray-200);
}
.ad-article_top .ad-item img,
.ad-article_middle .ad-item img,
.ad-article_bottom .ad-item img { max-height: 150px; border-radius: var(--radius-sm); }
/* Sidebar */
.ad-sidebar { padding: 0; }
.ad-sidebar .ad-item { margin-bottom: 15px; }
.ad-sidebar .ad-item img { border-radius: var(--radius-sm); }
/* Footer */
.ad-footer_above {
    background: var(--gray-100);
    padding: 15px 0;
    border-top: 1px solid var(--gray-200);
}
.ad-footer_above .ad-item img { max-height: 120px; }
@media (max-width: 768px) {
    .ad-header_below .ad-item img,
    .ad-hero_below .ad-item img,
    .ad-footer_above .ad-item img { max-height: 80px; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 968px) {
    .nav {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 10px 0;
        box-shadow: var(--shadow-lg);
        z-index: 999;
        align-items: stretch;
    }
    .nav.active { display: flex; }
    .mobile-toggle { display: block; }
    .nav > a:not(.btn-client-area), .nav-dropdown-toggle { padding: 12px 20px; }
    .nav > a:not(.btn-client-area)::after, .nav-dropdown-toggle::after { display: none; }
    .nav-dropdown { position: static; }
    .nav-dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border-top: none;
        border-radius: 0;
        display: none;
        background: var(--gray-100);
        pointer-events: auto;
    }
    .nav-dropdown:hover > .nav-dropdown-menu { display: none; opacity: 1; visibility: visible; pointer-events: auto; }
    .nav-dropdown.open > .nav-dropdown-menu { display: block; }
    .nav-dropdown-menu a { padding-left: 35px; }
    .btn-client-area {
        margin: 10px 15px !important;
        text-align: center;
        justify-content: center;
        border-radius: 50px;
    }
}

@media (max-width: 768px) {
    .hero h1 { font-size: 1.8rem; }
    .hero p { font-size: 1rem; }
    .articles-grid { grid-template-columns: 1fr; }
    .blog-layout { grid-template-columns: 1fr; }
    .article-content { padding: 25px 20px; margin: -20px 10px 30px; }
    .footer-grid { grid-template-columns: 1fr; }
    .categories-list { justify-content: flex-start; }
}

@media (max-width: 480px) {
    .hero { padding: 50px 0; }
    .hero h1 { font-size: 1.5rem; }
    .section-title { font-size: 1.3rem; }
}
