/* ============================================================
   LD Services — Mobile Responsive Stylesheet
   Covers: 320px – 768px phones, 768px – 1024px tablets
   ============================================================ */

/* ── CSS Variable Defaults (overridden by JS in header.php) ── */
:root {
    --banner-height: 0px;   /* 0 when no announcement banner is active */
    --header-height: 70px;  /* fallback; JS measures the real header height */
}

/* ── Mobile Nav Panel: custom scrollbar ── */
.nav-links::-webkit-scrollbar {
    width: 4px;
}
.nav-links::-webkit-scrollbar-track {
    background: transparent;
}
.nav-links::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
}
.nav-links::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ── Header Button Helpers (desktop + mobile) ── */
.hdr-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 6px 13px !important;
    font-size: 0.84rem !important;
    white-space: nowrap !important;
    min-height: 36px !important;
}
.hdr-icon-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 6px 12px !important;
    font-size: 0.85rem !important;
    min-height: 36px !important;
    min-width: 36px !important;
    position: relative !important;
}

/* Notification badge dot */
.notif-badge-dot {
    position: absolute;
    top: -4px; right: -4px;
    background: #ef4444;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 16px; height: 16px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid #0b0b14;
    box-shadow: 0 0 8px rgba(239,68,68,0.4);
}

/* Notification dropdown panel */
.notif-dropdown-panel {
    position: absolute;
    top: 42px; right: 0;
    width: 320px;
    background: rgba(13,15,19,0.97);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    z-index: 2000;
    padding: 15px;
    text-align: left;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding-bottom: 8px;
    margin-bottom: 10px;
}
.notif-header h4 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.9rem; color: #fff; margin: 0; font-weight: 600;
}
.notif-mark-all {
    background: none; border: none;
    color: #a78bfa; font-size: 0.72rem;
    cursor: pointer; font-weight: 600; padding: 2px 6px;
    touch-action: manipulation;
}
.notif-list-container {
    max-height: 250px;
    overflow-y: auto;
    display: flex; flex-direction: column; gap: 8px;
}
.notif-empty {
    text-align: center;
    color: var(--text-dark, #64748b);
    padding: 15px; font-size: 0.8rem;
}

/* ── Mobile Session Links (injected into nav panel) ── */
.mob-session-divider {
    width: 100%;
    height: 1px;
    background: rgba(255,255,255,0.07);
    margin: 10px 0 6px;
}
.mob-session-link {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
    padding: 12px 16px !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: var(--text-muted, #94a3b8) !important;
    text-decoration: none !important;
    border-radius: 8px !important;
    border: 1px solid transparent !important;
    transition: background 0.18s, color 0.18s, border-color 0.18s !important;
    touch-action: manipulation !important;
    min-height: 44px !important;
}
.mob-session-link:hover,
.mob-session-link:active {
    background: rgba(79,70,229,0.14) !important;
    color: #fff !important;
    border-color: rgba(79,70,229,0.3) !important;
}
.mob-session-link.mob-logout {
    color: rgba(239,68,68,0.8) !important;
}
.mob-session-link.mob-logout:hover,
.mob-session-link.mob-logout:active {
    background: rgba(239,68,68,0.1) !important;
    color: #ef4444 !important;
    border-color: rgba(239,68,68,0.25) !important;
}

@media (max-width: 1024px) {
    /* ── GLOBAL MOBILE FIXES ── */
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        -webkit-text-size-adjust: 100%;
    }

    *, *::before, *::after {
        box-sizing: border-box !important;
        max-width: 100%;
    }

    img, video, iframe {
        max-width: 100% !important;
        height: auto;
    }

    .container {
        width: 92% !important;
        padding: 0 !important;
    }
}

/* Prevent iOS auto-zoom on input focus — inputs must be ≥ 16px */
@media (max-width: 768px) {
    input, textarea, select {
        font-size: 16px !important;
    }
}

/* ── ANNOUNCEMENT BANNER ── */
@media (max-width: 768px) {
    .announcement-banner {
        font-size: 0.75rem !important;
        padding: 0 10px !important;
        white-space: normal !important;
        height: auto !important;
        min-height: 36px !important;
        text-align: center !important;
        flex-wrap: wrap !important;
    }
    .announcement-banner > div {
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: unset !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 4px !important;
        padding: 6px 0 !important;
    }
}

/* ── HEADER / NAVIGATION ── */
@media (max-width: 1024px) {
    .hide-mobile {
        display: none !important;
    }

    /* Hide text-label buttons from header on mobile — they live in the nav panel instead */
    .desktop-only {
        display: none !important;
    }

    /* On mobile, only show icon (hide label text) inside header buttons */
    .hdr-btn-text {
        display: none !important;
    }

    /* Notification dropdown: full width on small screens */
    .notif-dropdown-panel {
        position: fixed !important;
        top: auto !important;
        left: 12px !important;
        right: 12px !important;
        width: auto !important;
        max-width: 100% !important;
    }

    header .nav-container {
        padding: 14px 0 !important;
        width: 92% !important;
        gap: 15px !important;
    }

    .menu-toggle {
        display: flex !important;
        z-index: 1100 !important;
        padding: 4px !important;
        margin-right: auto !important;
        margin-left: 15px !important;
    }

    .nav-links {
        position: fixed !important;
        /* Sit directly below the header (which itself is offset by --banner-height) */
        top: calc(var(--header-height, 70px) + var(--banner-height, 0px)) !important;
        left: -100% !important;
        width: 80% !important;
        max-width: 320px !important;
        /* Fill all remaining vertical space below header */
        height: calc(100dvh - var(--header-height, 70px) - var(--banner-height, 0px)) !important;
        max-height: calc(100dvh - var(--header-height, 70px) - var(--banner-height, 0px)) !important;
        background: rgba(15, 17, 23, 0.97) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: flex-start !important;
        /* Remove fixed top padding — nav items start from top of panel */
        padding: 20px 30px 40px !important;
        gap: 8px !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        transition: left 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
        z-index: 1050 !important;
        border-right: 1px solid rgba(255,255,255,0.07) !important;
        box-shadow: 10px 0 40px rgba(0,0,0,0.5) !important;
    }

    .nav-links.active {
        left: 0 !important;
    }

    /* Overlay behind nav */
    .nav-overlay {
        display: none;
        position: fixed;
        top: 0; left: 0;
        width: 100%; height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 999 !important;
        backdrop-filter: blur(3px);
    }
    .nav-overlay.active {
        display: block;
    }

    .nav-links li {
        width: 100% !important;
    }

    .nav-links a {
        font-size: 1rem !important;
        font-weight: 600 !important;
        padding: 12px 16px !important;
        width: 100% !important;
        display: block !important;
        border-radius: 8px !important;
        color: rgba(255, 255, 255, 0.85) !important;
        transition: all 0.2s !important;
        border: 1px solid transparent !important;
    }

    .nav-links a:hover,
    .nav-links a.active {
        color: #fff !important;
        background: rgba(79, 70, 229, 0.16) !important;
        border-color: rgba(79, 70, 229, 0.35) !important;
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.25);
    }

    .nav-links a::after {
        display: none !important;
    }

    .header-actions {
        gap: 8px !important;
    }

    .lang-switch {
        display: none !important;
    }

    .status-badge {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .header-actions .btn {
        padding: 5px 8px !important;
        font-size: 0.76rem !important;
    }

    /* Hide text labels in header buttons on small phones, show only icons */
    .header-actions .btn span {
        display: none !important;
    }

    .logo {
        font-size: 1.2rem !important;
        gap: 8px !important;
    }

    .logo-img {
        width: 28px !important;
        height: 28px !important;
    }
}

/* ── HERO SECTION ── */
@media (max-width: 768px) {
    .hero {
        padding-top: 130px !important;
        padding-bottom: 70px !important;
    }

    .hero-title {
        font-size: 2rem !important;
        line-height: 1.15 !important;
        letter-spacing: -0.02em !important;
    }

    .hero-desc {
        font-size: 1rem !important;
        margin-bottom: 28px !important;
    }

    .hero-badge {
        font-size: 0.72rem !important;
        padding: 5px 12px !important;
        margin-bottom: 18px !important;
    }

    .hero-actions {
        flex-direction: column !important;
        gap: 12px !important;
        align-items: center !important;
    }

    .hero-actions .btn {
        width: 100% !important;
        max-width: 320px !important;
        justify-content: center !important;
    }
}

@media (max-width: 480px) {
    .hero {
        padding-top: 110px !important;
        padding-bottom: 50px !important;
    }

    .hero-title {
        font-size: 1.7rem !important;
    }

    .hero-desc {
        font-size: 0.92rem !important;
    }
}

/* ── SECTION GENERAL ── */
@media (max-width: 768px) {
    .section-padding {
        padding: 60px 0 !important;
    }

    .section-header {
        margin-bottom: 36px !important;
    }

    .section-title {
        font-size: 1.9rem !important;
    }

    .section-subtitle {
        font-size: 0.95rem !important;
    }
}

/* ── ABOUT SECTION ── */
@media (max-width: 991px) {
    .about-grid {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }

    .about-visual {
        height: 280px !important;
    }

    .about-stats {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 12px !important;
    }

    .stat-card {
        padding: 16px 10px !important;
    }

    .stat-number {
        font-size: 1.6rem !important;
    }
}

@media (max-width: 576px) {
    .about-stats {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .about-icon-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    .about-icon-item {
        padding: 20px 12px !important;
    }

    .about-icon-item i {
        font-size: 1.8rem !important;
    }

    .about-icon-item span {
        font-size: 0.9rem !important;
    }
}

/* ── SERVICES GRID ── */
@media (max-width: 768px) {
    .services-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    .service-card {
        padding: 24px 20px !important;
    }
}

/* ── TEAM GRID ── */
@media (max-width: 768px) {
    .team-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 14px !important;
        max-width: 100% !important;
    }
}

@media (max-width: 480px) {
    .team-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    .team-card {
        padding: 16px 10px !important;
    }

    .team-img-wrapper {
        width: 70px !important;
        height: 70px !important;
    }

    .team-name {
        font-size: 0.95rem !important;
    }

    .team-role {
        font-size: 0.65rem !important;
    }
}

/* ── PORTFOLIO / SHOWCASE SECTION ── */
@media (max-width: 991px) {
    .showcase-journey-grid {
        grid-template-columns: 1fr !important;
        gap: 40px !important;
    }

    .showcase-media-container {
        height: 240px !important;
    }

    .showcase-thumbnails {
        gap: 10px !important;
    }

    .showcase-thumb {
        flex: 0 0 100px !important;
    }

    .thumb-img-wrapper {
        height: 56px !important;
    }
}

@media (max-width: 576px) {
    .showcase-media-container {
        height: 200px !important;
    }

    .section-title-alt {
        font-size: 1.5rem !important;
    }

    .main-showcase-card {
        padding: 16px !important;
    }

    .showcase-title {
        font-size: 1.2rem !important;
    }

    /* Journey side */
    .journey-timeline {
        padding-left: 20px !important;
        gap: 24px !important;
    }

    .journey-marker {
        left: -28px !important;
    }

    .journey-title {
        font-size: 1rem !important;
    }
}

/* ── TIMELINE SECTION ── */
@media (max-width: 768px) {
    .timeline-container::after {
        left: 20px !important;
    }

    .timeline-item {
        width: 100% !important;
        padding-left: 55px !important;
        padding-right: 15px !important;
    }

    .timeline-item::after {
        left: 12px !important;
        right: auto !important;
    }

    .timeline-left,
    .timeline-right {
        left: 0 !important;
        text-align: left !important;
    }
}

/* ── REVIEWS / RATINGS ── */
@media (max-width: 768px) {
    .reviews-grid,
    .reviews-list {
        grid-template-columns: 1fr !important;
    }
}

/* ── HOSTING PLANS ── */
@media (max-width: 768px) {
    .hosting-tabs {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    .hosting-plans-grid,
    .plans-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    .plan-card,
    .hosting-plan-card {
        padding: 24px 18px !important;
    }

    /* Hide horizontal overflow bars */
    .hosting-tabs::-webkit-scrollbar {
        display: none !important;
    }
}

/* ── FAQ SECTION ── */
@media (max-width: 768px) {
    .faq-question {
        padding: 16px 16px !important;
        font-size: 0.9rem !important;
    }

    .faq-item.active .faq-answer {
        padding: 0 16px 16px 44px !important;
    }

    .faq-answer {
        font-size: 0.88rem !important;
    }
}

/* ── CONTACT SECTION ── */
@media (max-width: 991px) {
    .contact-grid {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }
}

@media (max-width: 768px) {
    .contact-form {
        padding: 24px 18px !important;
    }

    .form-row {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }
}

/* ── FOOTER ── */
@media (max-width: 991px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 30px !important;
    }
}

@media (max-width: 600px) {
    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 28px !important;
    }

    .footer-grid > div {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }

    .footer-bottom {
        flex-direction: column !important;
        gap: 12px !important;
        text-align: center !important;
    }

    footer {
        padding: 40px 0 20px !important;
    }
}

/* ── LIGHTBOX MODAL (Portfolio) ── */
@media (max-width: 768px) {
    .lightbox-content {
        max-width: 95% !important;
        max-height: 90vh !important;
    }

    #lightbox-img {
        max-height: 50vh !important;
    }

    .lightbox-prev { left: 8px !important; }
    .lightbox-next { right: 8px !important; }

    .lightbox-prev,
    .lightbox-next {
        width: 36px !important;
        height: 36px !important;
        font-size: 0.85rem !important;
    }

    .lightbox-caption {
        margin-top: 12px !important;
        max-width: 90% !important;
    }

    #lightbox-title {
        font-size: 1rem !important;
    }

    .lightbox-close {
        top: 12px !important;
        right: 12px !important;
        width: 36px !important;
        height: 36px !important;
        font-size: 1.1rem !important;
    }
}

/* ── TEAM MODAL ── */
@media (max-width: 480px) {
    .team-modal-content {
        width: 95% !important;
        padding: 20px 16px !important;
    }

    .team-modal-name {
        font-size: 1.15rem !important;
    }
}

/* ── NOTIFICATIONS DROPDOWN ── */
@media (max-width: 480px) {
    #notif-dropdown {
        position: fixed !important;
        top: 70px !important;
        left: 12px !important;
        right: 12px !important;
        width: auto !important;
        max-width: none !important;
        transform: none !important;
        z-index: 99999 !important;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7) !important;
    }
}

/* ── LOGIN / REGISTER PAGES ── */
@media (max-width: 600px) {
    .login-container,
    .auth-container,
    .register-container {
        padding: 20px 16px !important;
        margin: 0 12px !important;
    }
}

/* ── CHANGELOGS PAGE ── */
@media (max-width: 768px) {
    .changelogs-container,
    .changelog-entry {
        padding: 20px 16px !important;
    }
}

/* ── PROFILE / CLIENT PORTAL ── */
@media (max-width: 991px) {
    .profile-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
}

/* ── TOOLS PAGE ── */
@media (max-width: 768px) {
    .tools-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
}

/* ── HOSTING CATEGORY BANNER ── */
@media (max-width: 768px) {
    .hosting-banner-card,
    .category-banner {
        padding: 20px 16px !important;
        flex-direction: column !important;
        text-align: center !important;
    }
}

/* ── FIX HORIZONTAL SCROLL (global) ── */
@media (max-width: 1024px) {
    section, header, footer, .container, main {
        max-width: 100vw !important;
    }
}

/* Prevent any element from causing horizontal overflow */
@media (max-width: 768px) {
    .hero-grid {
        display: none !important; /* Remove decorative grid on mobile for perf */
    }

    .bg-glow-1,
    .bg-glow-2 {
        width: 300px !important;
        height: 300px !important;
        filter: blur(60px) !important;
        opacity: 0.3 !important;
    }

    /* Automated Responsive Tables to Cards */
    .table-container {
        overflow-x: visible !important;
    }
    table {
        display: table !important;
        border: none !important;
        background: transparent !important;
        width: 100% !important;
    }
    table thead {
        display: none !important;
    }
    table tbody, table tr, table td {
        display: block !important;
        width: 100% !important;
    }
    table tr {
        background: rgba(255, 255, 255, 0.02) !important;
        border: 1px solid var(--border) !important;
        border-radius: var(--radius-md) !important;
        padding: 12px !important;
        margin-bottom: 16px !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    }
    table td {
        border: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
        padding: 10px 0 !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        text-align: right !important;
        font-size: 0.88rem !important;
        white-space: normal !important;
    }
    table td:last-child {
        border-bottom: none !important;
        padding-bottom: 0 !important;
        margin-top: 5px !important;
    }
    table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--secondary);
        text-align: left;
        margin-right: 15px;
        font-size: 0.8rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    /* Buttons full width on mobile for better tap targets */
    .hero-actions .btn,
    .contact-form .btn {
        min-height: 48px !important;
    }

    /* Touch targets and form elements */
    .form-control, select, textarea, input[type="text"], input[type="password"], input[type="number"], input[type="email"] {
        min-height: 44px !important;
        font-size: 16px !important;
    }
}

/* ── TOUCH TARGETS ── */
@media (max-width: 768px) {
    a, button {
        min-height: 40px !important;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .nav-links a {
        min-height: 48px !important;
    }
}

/* ── SERVERS PAGE ── */
@media (max-width: 768px) {
    .servers-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }
}

/* ── DOCS/WIKI PAGE ── */
@media (max-width: 768px) {
    .docs-layout,
    .wiki-layout {
        flex-direction: column !important;
    }

    .docs-sidebar,
    .wiki-sidebar {
        width: 100% !important;
        position: relative !important;
        top: 0 !important;
    }

    .docs-content,
    .wiki-content {
        padding: 20px 16px !important;
    }
}

/* ── INVOICE PAGE ── */
@media (max-width: 600px) {
    .invoice-container {
        padding: 20px 14px !important;
        margin: 10px !important;
    }

    .invoice-header {
        flex-direction: column !important;
        gap: 16px !important;
    }
}

/* ── CUSTOM INVOICE TABLE ── */
@media (max-width: 600px) {
    .invoice-items-table {
        font-size: 0.8rem !important;
    }
}

/* ── PREVENT ICONS BREAKING ── */
@media (max-width: 1024px) {
    .fas, .far, .fab, .fa {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
    }
}

/* ── REVIEWS STARS ── */
@media (max-width: 480px) {
    .reviews-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ── FIX STATS CARD OVERFLOW ── */
@media (max-width: 360px) {
    .stat-number {
        font-size: 1.4rem !important;
    }

    .stat-label {
        font-size: 0.75rem !important;
    }

    .hero-title {
        font-size: 1.5rem !important;
    }

    .section-title {
        font-size: 1.6rem !important;
    }
}

/* ── NAV MENU OPEN: PREVENT BODY SCROLL ── */
@media (max-width: 1024px) {
    body.nav-open {
        overflow: hidden !important;
    }
}

/* ── HOSTING BOTTOM GRID RESPONSIVENESS ── */
@media (max-width: 768px) {
    .hosting-bottom-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
}
