/* ============================================================
   USMANI CYBER CAFE - PROFESSIONAL THEME
   ============================================================ */

:root {
    --primary:       #1565c0;
    --primary-dark:  #0d47a1;
    --primary-light: #e3f2fd;
    --accent:        #ff6f00;
    --accent-light:  #fff3e0;
    --success:       #2e7d32;
    --success-light: #e8f5e9;
    --danger:        #d32f2f;
    --danger-light:  #ffebee;
    --bg-body:       #f5f7fa;
    --bg-card:       #ffffff;
    --text:          #263238;
    --text-light:    #607d8b;
    --text-muted:    #90a4ae;
    --border:        #e0e0e0;
    --shadow-sm:     0 1px 3px rgba(0,0,0,0.06);
    --shadow:        0 2px 8px rgba(0,0,0,0.08);
    --shadow-md:     0 4px 16px rgba(0,0,0,0.1);
    --shadow-lg:     0 8px 30px rgba(0,0,0,0.12);
    --radius:        8px;
    --radius-sm:     6px;
    --radius-lg:     12px;
    --font:          'Segoe UI', system-ui, -apple-system, sans-serif;
    --header-gradient: linear-gradient(135deg, #0a2647, #0d47a1, #1565c0);
    --navbar-gradient: linear-gradient(135deg, #0d2b4e, #0d47a1);
    --ticker-gradient: linear-gradient(90deg, #0d3158, #0d47a1, #1565c0);
    --ticker-label-gradient: linear-gradient(135deg, #e65100, #ff6f00);
    --footer-gradient: linear-gradient(135deg, #0d47a1, #1565c0, #1976d2);
    --footer-accent-border: linear-gradient(90deg, var(--accent), #ffb74d, var(--accent));
    --hero-accent-bar: linear-gradient(90deg, var(--accent), #ffb74d, var(--accent));
    --clock-gradient: linear-gradient(135deg, #1a237e, #283593);
    --notice-section-gradient: linear-gradient(180deg, var(--primary-light) 0%, var(--bg-body) 100%);
}

/* ----- BASE ----- */
body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg-body);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--primary);
    color: #fff;
}

.container {
    max-width: 1200px;
}

.section-py {
    padding: 3rem 0;
}

/* Page Hero */
.page-hero {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    padding: 3rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.page-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--hero-accent-bar);
}
.page-hero-title {
    color: #fff;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.page-hero-sub {
    color: rgba(255,255,255,0.8);
    font-size: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 2px 16px rgba(0,0,0,0.1);
}

.header-top {
    background: var(--header-gradient);
    color: #fff;
    padding: 0.55rem 0;
}

.site-logo {
    width: 46px;
    height: 46px;
    object-fit: contain;
    border-radius: 6px;
    background: rgba(255,255,255,0.12);
    padding: 3px;
    transition: opacity 0.25s;
}
.site-logo:hover { opacity: 0.85; }

.site-title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0.2px;
}

.site-tagline {
    font-size: 0.7rem;
    opacity: 0.7;
    display: block;
    font-weight: 400;
    letter-spacing: 0.3px;
}

.header-actions {
    gap: 0.75rem !important;
}
.header-actions a {
    color: rgba(255,255,255,0.8);
    font-size: 1rem;
    transition: color 0.2s;
}
.header-actions a:hover { color: #fff; }

.cart-badge {
    position: absolute;
    top: -5px;
    right: -7px;
    background: var(--accent);
    color: #fff;
    font-size: 0.55rem;
    font-weight: 700;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.25);
}

.search-toggle {
    font-size: 0.85rem !important;
    padding: 0.25rem 0.6rem !important;
    border-radius: 6px !important;
    border-color: rgba(255,255,255,0.25) !important;
    color: rgba(255,255,255,0.8) !important;
    transition: all 0.2s;
}
.search-toggle:hover {
    background: rgba(255,255,255,0.12) !important;
    color: #fff !important;
    border-color: rgba(255,255,255,0.4) !important;
}

/* Navigation */
.navbar {
    background: var(--navbar-gradient) !important;
    padding: 0;
    min-height: 46px;
    position: relative;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.navbar-toggler {
    border: 1px solid rgba(255,255,255,0.2);
    padding: 0.25rem 0.4rem;
    border-radius: 4px;
    transition: border-color 0.2s;
}
.navbar-toggler:hover { border-color: rgba(255,255,255,0.5); }
.navbar-toggler:focus { box-shadow: 0 0 0 2px rgba(255,255,255,0.15); }
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='rgba(255,255,255,0.85)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
    width: 20px;
    height: 20px;
}

.navbar .navbar-nav {
    gap: 0;
}

.navbar .nav-link {
    color: rgba(255,255,255,0.78) !important;
    padding: 0.65rem 1rem !important;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    transition: color 0.2s, background 0.2s;
    position: relative;
    border-radius: 0;
    display: flex;
    align-items: center;
    border-bottom: 2px solid transparent;
}
.navbar .nav-link:hover,
.navbar .nav-link:focus {
    color: #fff !important;
    background: rgba(255,255,255,0.06);
}
.navbar .nav-link.active {
    color: #fff !important;
    border-bottom-color: var(--accent);
    background: rgba(255,255,255,0.04);
}

.nav-icon {
    display: inline-block;
    margin-right: 0.35rem;
    font-size: 0.8rem;
}

.navbar .dropdown-menu {
    border: none;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    padding: 0.4rem;
    margin-top: 0;
    border-top: 3px solid var(--accent);
}

@media (min-width: 992px) {
    .navbar .dropdown-menu {
        display: block;
        visibility: hidden;
        opacity: 0;
        transition: opacity 0.15s ease, visibility 0.15s ease;
        transform-origin: top center;
        animation: dropdownSlide 0.2s ease-out;
    }
    .navbar .dropdown:hover .dropdown-menu {
        visibility: visible;
        opacity: 1;
    }
    @keyframes dropdownSlide {
        from { opacity: 0; transform: translateY(-6px) scaleY(0.95); }
        to   { opacity: 1; transform: translateY(0) scaleY(1); }
    }
}

@media (max-width: 991.98px) {
    .navbar .dropdown-menu {
        display: none;
        background: rgba(255,255,255,0.08);
        border: none;
        box-shadow: none;
        padding: 0 0 0 1rem;
        margin: 0;
        border-top: none;
        position: static;
        float: none;
    }
    .navbar .dropdown.open > .dropdown-menu {
        display: block;
    }
    .navbar .dropdown-item {
        color: #fff !important;
        padding: 0.4rem 0.9rem !important;
        font-size: 0.78rem;
    }
    .navbar .dropdown-item:hover {
        background: rgba(255,255,255,0.15);
        color: #fff !important;
    }
    .navbar .dropdown-item i {
        color: #fff !important;
        font-size: 0.85rem;
        width: 18px;
        text-align: center;
        margin-right: 0.5rem;
    }
}

.navbar .dropdown-item {
    font-size: 0.8rem;
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-weight: 500;
}
.navbar .dropdown-item:hover {
    background: #e8eaf6;
    color: var(--primary);
}
.navbar .dropdown-item i {
    width: 16px;
    text-align: center;
    margin-right: 0.35rem;
    color: var(--primary);
}

.search-bar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 0.65rem 0;
}
.search-bar .form-control {
    border-radius: 8px;
    padding-left: 1rem;
    font-size: 0.85rem;
    border: 1px solid var(--border);
}
.search-bar .btn {
    border-radius: 8px;
}

/* ============================================================
   NOTICE BOARD
   ============================================================ */
.notice-section {
    background: var(--notice-section-gradient);
    padding: 1.5rem 0;
}

.notice-box {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow);
    height: 100%;
    border-left: 4px solid var(--primary);
    transition: transform 0.25s, box-shadow 0.25s;
}
.notice-box:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.notice-box.important { border-left-color: var(--danger); }
.notice-box.regular  { border-left-color: var(--accent); }

.notice-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.notice-box.important .notice-title { color: var(--danger); }
.notice-box.regular  .notice-title  { color: var(--accent); }

.notice-box p {
    color: var(--text-light);
    font-size: 0.88rem;
    line-height: 1.6;
}

/* ---- Notice + Banner Section ---- */
.notice-banner-section {
    background: var(--notice-section-gradient);
    padding: 1.5rem 0 0;
}
.notice-banner-section .notice-box {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.notice-banner-section .banner-card img {
    min-height: 260px !important;
    max-height: 440px !important;
}

/* ---- News Ticker ---- */
.news-ticker {
    background: var(--ticker-gradient);
    color: rgba(255,255,255,0.92);
    display: flex;
    align-items: stretch;
    overflow: hidden;
    font-size: 0.82rem;
    height: 42px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
    border-bottom: 1px solid rgba(255,183,77,0.25);
}

.ticker-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--ticker-label-gradient);
    padding: 0 1.4rem 0 1.2rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    white-space: nowrap;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    font-size: 0.72rem;
    color: #fff;
}
.ticker-label i {
    font-size: 0.8rem;
}
.ticker-label::after {
    content: '';
    position: absolute;
    right: -10px;
    top: 0;
    width: 0;
    height: 0;
    border-top: 21px solid transparent;
    border-bottom: 21px solid transparent;
    border-left: 10px solid var(--accent);
}

.ticker-track-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
    padding: 0 1rem;
}

.ticker-track {
    display: flex;
    width: max-content;
    animation: tickerScroll 35s linear infinite;
}

.ticker-items {
    display: flex;
    align-items: center;
    gap: 4rem;
    padding: 0 0.5rem;
}

.ticker-item {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    letter-spacing: 0.2px;
}
.ticker-item::before {
    content: '\f0a1';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.55rem;
    color: #ffb74d;
    opacity: 0.9;
}

@keyframes tickerScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.news-ticker:hover .ticker-track {
    animation-play-state: paused;
}

/* ============================================================
   HERO BANNER
   ============================================================ */
.hero-banner {
    padding: 1.5rem 0;
    background: var(--bg-body);
}

.banner-card {
    box-shadow: var(--shadow);
    border-radius: var(--radius-lg) !important;
}

.banner-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent 20%, rgba(0,0,0,0.8) 100%);
    padding: 2.5rem 2rem 1.5rem;
}

.banner-content h2 {
    font-size: 1.75rem;
    font-weight: 800;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
    margin-bottom: 0.4rem;
}

.banner-content p {
    font-size: 0.95rem;
    opacity: 0.95;
    max-width: 700px;
    margin: 0 auto;
}

/* ============================================================
   TRENDING LINKS
   ============================================================ */
.trending-section {
    background: var(--bg-card);
}

.section-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 1.25rem;
    padding-bottom: 0.6rem;
    border-bottom: 3px solid var(--accent);
    display: inline-block;
    letter-spacing: 0.3px;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 0.6rem;
}

.trending-link-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-body);
    color: var(--text);
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid var(--border);
    transition: all 0.25s;
    gap: 0.5rem;
}
.trending-link-btn span { flex: 1; }

.trending-link-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(21,101,192,0.3);
}

.trending-link-btn i {
    opacity: 0.4;
    font-size: 0.75rem;
    transition: opacity 0.2s;
}
.trending-link-btn:hover i { opacity: 1; }

/* ============================================================
   SERVICES
   ============================================================ */
.services-section {
    background: var(--bg-body);
}

.service-list {
    list-style: none;
    padding-left: 0;
    columns: 2;
    column-gap: 2rem;
}
@media (max-width: 576px) {
    .service-list { columns: 1; }
}

.service-list li {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    break-inside: avoid;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.service-list li i {
    color: var(--success);
    margin-top: 0.2rem;
    flex-shrink: 0;
}

/* ============================================================
   MANAGER SECTION
   ============================================================ */
.manager-section {
    background: var(--bg-card);
}

.manager-card {
    background: linear-gradient(180deg, #e8eaf6, #ffffff);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    border: 1px solid #e0e0e0;
    box-shadow: var(--shadow);
}

.manager-photo {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid #fff;
    box-shadow: var(--shadow-md);
}

.author-bio {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

/* Join Icons */
.join-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: #fff;
    font-size: 1.25rem;
    transition: all 0.3s;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.join-icon:nth-child(1) { background: linear-gradient(135deg, #0088cc, #0099dd); }
.join-icon:nth-child(2) { background: linear-gradient(135deg, #25d366, #128c7e); }
.join-icon:nth-child(3) { background: linear-gradient(135deg, #ff0000, #cc0000); }

.join-icon:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
    color: #fff;
}

.social-icon-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 0.85rem;
    transition: all 0.3s;
    text-decoration: none;
}
.social-icon-sm:hover {
    background: var(--accent);
    color: #fff;
    transform: translateY(-2px);
}

/* ============================================================
   BOTTOM SECTION
   ============================================================ */
.bottom-section {
    background: #f5f7fa;
}

.service-tags {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #fff;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius);
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.8;
    box-shadow: var(--shadow);
    word-spacing: 0.15rem;
}

.bottom-section img {
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}
.bottom-section img:hover {
    transform: scale(1.01);
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar-widget {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
    transition: box-shadow 0.25s;
}
.sidebar-widget:hover {
    box-shadow: var(--shadow);
}

.widget-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-dark);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 0.6rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.widget-title i { color: var(--accent); }

/* Clock */
.clock-widget {
    background: var(--clock-gradient);
    border-radius: var(--radius);
    margin: -0.25rem -0.5rem 0.75rem -0.5rem;
    padding: 1rem 0.5rem !important;
}

.clock-display {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: #fff;
    letter-spacing: 3px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.clock-date {
    color: rgba(255,255,255,0.75);
    font-size: 0.78rem;
    margin-top: 0.25rem;
}

/* Calendar */
.calendar-widget {
    font-size: 0.85rem;
}
.calendar-widget table {
    width: 100%;
    border-collapse: collapse;
}
.calendar-widget th {
    color: var(--text-light);
    font-weight: 600;
    text-align: center;
    padding: 0.3rem 0;
    font-size: 0.78rem;
    border-bottom: 1px solid var(--border);
}
.calendar-widget td {
    text-align: center;
    padding: 0.3rem 0;
    font-size: 0.85rem;
    border-radius: 4px;
    transition: background 0.2s;
    cursor: default;
}
.calendar-widget td:not(.today):hover {
    background: var(--primary-light);
}
.calendar-widget td.today {
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    line-height: 32px;
    padding: 0;
}
.calendar-widget .cal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
}
.calendar-widget .cal-header button {
    background: var(--bg-body);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}
.calendar-widget .cal-header button:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.calendar-widget .cal-header .month-year {
    font-weight: 700;
    color: var(--text);
    font-size: 0.9rem;
}

/* Sidebar Links */
.sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.sidebar-links a {
    background: var(--bg-body);
    color: var(--text);
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    border: 1px solid var(--border);
    transition: all 0.25s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.sidebar-links a::before {
    content: '\f101';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.65rem;
    color: var(--accent);
    transition: transform 0.2s;
}
.sidebar-links a:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    padding-left: 1rem;
}
.sidebar-links a:hover::before {
    transform: translateX(3px);
    color: #fff;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
    background: var(--footer-gradient);
    color: rgba(255,255,255,0.9);
    position: relative;
}
.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--footer-accent-border);
}

.footer h5 {
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1.1rem;
    letter-spacing: 0.3px;
    position: relative;
    padding-bottom: 0.5rem;
}
.footer h5::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--accent);
}

.footer a {
    color: rgba(255,255,255,0.78);
    text-decoration: none;
    transition: all 0.25s;
    font-size: 0.88rem;
}
.footer a:hover {
    color: #fff;
    padding-left: 4px;
}

.footer ul li {
    margin-bottom: 0.15rem;
}

.footer-social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: #fff !important;
    transition: all 0.3s;
    font-size: 1rem;
    border: 1px solid rgba(255,255,255,0.15);
}
.footer-social-icon:hover {
    background: var(--accent) !important;
    border-color: var(--accent);
    transform: translateY(-3px);
    padding-left: 0 !important;
    box-shadow: 0 4px 12px rgba(255,111,0,0.3);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.12);
    font-size: 0.85rem;
}

/* ============================================================
   AD CONTAINER — Clean AdSense Display
   ============================================================ */
.ad-wrapper {
    text-align: center;
    margin: 1.5rem auto;
    max-width: 100%;
}
.ad-wrapper-inner {
    display: inline-block;
    max-width: 100%;
    position: relative;
}
.ad-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--text-muted, #90a4ae);
    margin-bottom: 6px;
    opacity: 0.7;
}
.ad-container {
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    max-width: 100%;
    min-height: 90px;
    border-radius: var(--radius, 8px);
    background: transparent;
    transition: opacity 0.4s ease;
}
.ad-container > * {
    max-width: 100%;
    height: auto;
}
.ad-container ins.adsbygoogle {
    display: block;
    background: transparent !important;
}

/* ---- Placement: Before Content (full-width banner) ---- */
.ad-wrapper.ad-before_content {
    margin: 0 0 1.5rem;
    padding: 0;
}
.ad-wrapper.ad-before_content .ad-container {
    min-height: 100px;
}

/* ---- Placement: After Content (full-width banner) ---- */
.ad-wrapper.ad-after_content {
    margin: 1.5rem 0 0;
    padding: 0;
}
.ad-wrapper.ad-after_content .ad-container {
    min-height: 100px;
}

/* ---- Placement: Sidebar (narrow) ---- */
.ad-wrapper.ad-sidebar {
    margin: 1.25rem 0;
}
.ad-wrapper.ad-sidebar .ad-container {
    min-height: 250px;
    border-radius: var(--radius, 8px);
}

/* ---- Placement: In-Article (between paragraphs) ---- */
.ad-wrapper.ad-in_article {
    margin: 2rem auto;
    max-width: 100%;
}
.ad-wrapper.ad-in_article .ad-container {
    min-height: 100px;
    background: var(--bg-body, #f5f7fa);
    border-radius: var(--radius, 8px);
}

/* ---- Placement: Multiplex (bottom of page) ---- */
.ad-wrapper.ad_multiplex {
    margin: 2rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid var(--border, #e0e0e0);
}

/* ---- Responsive Ad Sizing ---- */
@media (max-width: 991.98px) {
    .ad-wrapper { margin: 1.25rem auto; }
    .ad-wrapper.ad-sidebar .ad-container { min-height: 200px; }
    .ad-wrapper.ad-before_content .ad-container,
    .ad-wrapper.ad-after_content .ad-container { min-height: 90px; }
}
@media (max-width: 767.98px) {
    .ad-wrapper { margin: 1rem auto; }
    .ad-label { font-size: 0.6rem; letter-spacing: 0.8px; }
    .ad-wrapper.ad-sidebar .ad-container { min-height: 200px; }
    .ad-wrapper.ad-before_content .ad-container,
    .ad-wrapper.ad-after_content .ad-container { min-height: 80px; }
}
@media (max-width: 575.98px) {
    .ad-wrapper { margin: 0.85rem auto; }
    .ad-wrapper.ad-sidebar .ad-container { min-height: 180px; }
    .ad-wrapper.ad-before_content .ad-container,
    .ad-wrapper.ad-after_content .ad-container { min-height: 60px; }
}

/* ---- Empty Ad Slot Cleanup (prevents layout jump when no ad is configured) ---- */
.ad-container:empty {
    display: none;
}
.ad-wrapper:has(.ad-container:empty) {
    display: none;
}

/* ============================================================
   THREE COLUMN SECTION
   ============================================================ */
.three-col-section {
    background: var(--bg-body);
}

.three-col-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.25rem 1rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: box-shadow 0.25s, transform 0.25s;
}
.three-col-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.three-col-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-dark);
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
    border-bottom: 2px solid var(--accent);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.three-col-title i { color: var(--accent); }

.three-col-links {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.three-col-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-body);
    color: var(--text);
    padding: 0.35rem 0.7rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid var(--border);
    transition: all 0.2s;
    gap: 0.4rem;
}
.three-col-link span { flex: 1; }
.three-col-link:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateX(3px);
}
.three-col-link i {
    opacity: 0.35;
    font-size: 0.65rem;
    transition: opacity 0.2s;
}
.three-col-link:hover i { opacity: 1; }

.three-col-list {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}
.three-col-list li {
    font-size: 0.8rem;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    color: var(--text-light);
}
.three-col-list li i {
    color: var(--success);
    margin-top: 0.15rem;
    flex-shrink: 0;
    font-size: 0.7rem;
}

.three-col-manager-img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: var(--shadow-md);
}

/* Full Services Section */
.full-services-section {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.full-services-section .service-list {
    columns: 2;
    column-gap: 2rem;
}
@media (max-width: 576px) {
    .full-services-section .service-list { columns: 1; }
}

/* ============================================================
   RESPONSIVE — Comprehensive
   ============================================================ */

/* ---- Extra large: 1200px down ---- */
@media (max-width: 1199.98px) {
    .page-hero-title { font-size: 1.7rem; }
}

/* ---- Large / Tablet: 992px down ---- */
@media (max-width: 991.98px) {
    .site-title { font-size: 1rem; }
    .site-tagline { font-size: 0.6rem; }

    .page-hero { padding: 2rem 0; }
    .page-hero-title { font-size: 1.5rem; }
    .page-hero-sub { font-size: 0.9rem; }

    .section-py { padding: 2rem 0; }

    .links-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

    .banner-content h2 { font-size: 1.35rem; }

    .three-col-card { padding: 1rem; }
    .sidebar-widget { padding: 1rem; }

    .clock-display { font-size: 1.8rem; }

    /* Footer: 2-col grid on tablet */
    .footer .row > [class*="col-"] { margin-bottom: 1.5rem; }

    .service-list { columns: 2; }
    .full-services-section .service-list { columns: 2; }
}

/* ---- Medium / Phone landscape: 768px down ---- */
@media (max-width: 767.98px) {
    /* ===== Header ===== */
    .header-top .container {
        flex-wrap: nowrap !important;
        align-items: center;
        gap: 0.3rem;
    }
    .header-top .navbar-toggler {
        flex-shrink: 0;
        padding: 2px 6px !important;
        font-size: 1.2rem !important;
    }
    .header-brand {
        flex: 1;
        min-width: 0;
        justify-content: center !important;
        text-align: center;
        gap: 0 !important;
    }
    .header-brand .site-logo { display: none; }
    .header-brand .site-title {
        font-size: 0.8rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin: 0 auto;
    }
    .header-brand .site-tagline { display: none; }
    .header-actions {
        flex-shrink: 0;
        flex-direction: row !important;
        gap: 0.4rem !important;
    }
    .header-actions a { font-size: 0.85rem; }
    .search-toggle { font-size: 0.75rem !important; padding: 0.15rem 0.45rem !important; }

    /* ===== Nav ===== */
    .navbar .navbar-nav { padding: 0.25rem 0; }

    /* ===== News Ticker ===== */
    .news-ticker { height: 36px; font-size: 0.72rem; }
    .ticker-label { font-size: 0.6rem; padding: 0 0.8rem 0 0.7rem; gap: 0.3rem; }
    .ticker-label i { display: none; }
    .ticker-label::after { border-top-width: 18px; border-bottom-width: 18px; border-left-width: 8px; right: -8px; }

    /* ===== Page Hero ===== */
    .page-hero { padding: 1.5rem 0; }
    .page-hero-title { font-size: 1.25rem; }
    .page-hero-sub { font-size: 0.82rem; }

    .section-py { padding: 1.5rem 0; }

    /* ===== Banner ===== */
    .banner-overlay {
        position: relative;
        background: linear-gradient(135deg, var(--primary-dark), var(--primary));
        padding: 1rem;
    }
    .banner-card img { min-height: 180px !important; }
    .banner-content h2 { font-size: 1.2rem; }
    .banner-content p { font-size: 0.82rem; }

    /* ===== Notice Board ===== */
    .notice-box { padding: 1rem; }
    .notice-title { font-size: 0.85rem; }
    .notice-box p { font-size: 0.78rem; }

    /* ===== Section Titles ===== */
    .section-title { font-size: 1.1rem; }

    /* ===== Cards ===== */
    .three-col-card { padding: 0.85rem; }
    .three-col-title { font-size: 0.85rem; }
    .three-col-link { font-size: 0.72rem; padding: 0.3rem 0.65rem; }
    .three-col-list li { font-size: 0.72rem; }
    .three-col-manager-img { width: 70px; height: 70px; }

    /* ===== Manager ===== */
    .manager-card { padding: 1.25rem 0.85rem; }
    .manager-photo { width: 100px; height: 100px; }
    .author-bio { padding: 1rem; }

    /* ===== Trending Links ===== */
    .links-grid { grid-template-columns: 1fr 1fr; }
    .trending-link-btn { padding: 0.45rem 0.75rem; font-size: 0.75rem; }

    /* ===== Clock & Calendar ===== */
    .clock-display { font-size: 1.4rem; letter-spacing: 1px; }
    .clock-date { font-size: 0.65rem; }
    .calendar-widget { font-size: 0.72rem; }
    .calendar-widget th { font-size: 0.65rem; padding: 0.2rem 0; }
    .calendar-widget td { font-size: 0.72rem; padding: 0.2rem 0; }
    .calendar-widget td.today { width: 26px; height: 26px; line-height: 26px; font-size: 0.65rem; }
    .calendar-widget .cal-header .month-year { font-size: 0.78rem; }
    .calendar-widget .cal-header button { font-size: 0.65rem; padding: 0.2rem 0.5rem; }

    /* ===== Sidebar ===== */
    .sidebar-widget { padding: 0.85rem; }
    .widget-title { font-size: 0.85rem; }
    .sidebar-links a { font-size: 0.72rem; padding: 0.35rem 0.65rem; }

    /* ===== Services Page ===== */
    .service-list { columns: 1; }
    .full-services-section .service-list { columns: 1; }
    .service-list li { font-size: 0.78rem; }

    /* ===== Bottom Section ===== */
    .service-tags { font-size: 0.78rem; padding: 1rem; }

    /* ===== Tables (site-wide) ===== */
    .table { font-size: 0.75rem; }
    .table th, .table td { padding: 0.3rem 0.35rem !important; white-space: nowrap; }
    .table-responsive { -webkit-overflow-scrolling: touch; }

    /* ===== Forms (site-wide) ===== */
    input, select, textarea, .form-control, .form-select {
        font-size: 16px !important; /* prevents iOS zoom */
    }

    /* ===== Shop Stationery ===== */
    .qty-input { width: 50px !important; }

    /* ===== Footer ===== */
    .footer { padding-top: 2rem !important; }
    .footer h5 { font-size: 0.85rem; margin-bottom: 0.8rem; }
    .footer a { font-size: 0.78rem; }
    .footer ul li { margin-bottom: 0.1rem; }
    .footer .row > [class*="col-"] { margin-bottom: 1.5rem; }
    .footer-social-icon { width: 32px; height: 32px; font-size: 0.8rem; }
    .footer-bottom { font-size: 0.75rem; }

    /* ===== Shop & Tool Pages ===== */
    .section-py .container .three-col-card { margin-bottom: 1rem; }

    /* ===== Appointment ===== */
    .appointment-form .row > [class*="col-"] { margin-bottom: 0.5rem; }

    /* ===== General Spacing ===== */
    .container { padding-left: 12px; padding-right: 12px; }

    /* ===== Join Icons ===== */
    .join-icon { width: 36px; height: 36px; font-size: 1rem; }
}

/* ---- Small / Phone portrait: 576px down ---- */
@media (max-width: 575.98px) {
    .page-hero-title { font-size: 1.1rem; }
    .page-hero-sub { font-size: 0.78rem; }

    .links-grid { grid-template-columns: 1fr; }

    .banner-overlay { padding: 0.85rem; }
    .banner-content h2 { font-size: 1rem; }
    .banner-content p { font-size: 0.78rem; }

    .three-col-card { padding: 0.75rem; }
    .three-col-title { font-size: 0.8rem; }

    .news-ticker { height: 32px; font-size: 0.65rem; }
    .ticker-label { font-size: 0.5rem; padding: 0 0.6rem 0 0.5rem; }
    .ticker-label::after { border-top-width: 16px; border-bottom-width: 16px; border-left-width: 6px; right: -6px; }

    .list-inline-item:not(:last-child) { margin-right: 0.25rem; }

    /* Prevent horizontal overflow */
    .container { overflow-x: hidden; }
}

/* ---- Extra small: 480px down ---- */
@media (max-width: 480px) {
    .links-grid { grid-template-columns: 1fr; }
    .service-tags { font-size: 0.72rem; padding: 0.85rem; }
    .banner-content h2 { font-size: 1rem; }
    .navbar .nav-link { padding: 0.5rem 0.75rem !important; font-size: 0.82rem; }
    .header-brand .site-title { font-size: 0.75rem; }
    .header-actions { gap: 0.25rem !important; }
    .clock-display { font-size: 1.2rem; }
    .page-hero { padding: 1rem 0; }
    .manager-photo { width: 80px; height: 80px; }
}

/* ---- Admin & Customer Dashboard table fixes ---- */
@media (max-width: 991.98px) {
    .table-card { padding: 0.75rem !important; }
    .table-card .table { font-size: 0.7rem; }
    .table-card .table th,
    .table-card .table td { padding: 0.25rem 0.3rem !important; }
    .sidebar { width: 220px !important; }
    .main-wrapper { margin-left: 0 !important; }
    .top-header { left: 0 !important; }
}

@media (max-width: 767.98px) {
    .sidebar { width: 200px !important; }
    .stat-card { padding: 0.75rem !important; }
    .stat-card h3 { font-size: 1rem !important; }
    .stat-card p { font-size: 0.7rem !important; }
    .table-card h5 { font-size: 0.85rem !important; }
}

/* ---- Blog Post responsive helpers ---- */
@media (max-width: 991.98px) {
    .article-container { max-width: 100% !important; padding: 0 16px !important; }
}
@media (max-width: 575.98px) {
    .article-container { padding: 0 10px !important; }
}
