/* ═══════════════════════════════════════════════════
   SOCIALMATIC.RO - Mobile Fixes (toate paginile)
   Adauga acest fisier pe fiecare pagina: <link rel="stylesheet" href="/mobile-fixes.css">
   sau include aceste reguli in fiecare pagina
   ═══════════════════════════════════════════════════ */

/* ═══ GLOBAL MOBILE FIXES ═══ */
@media (max-width: 900px) {
  /* Fix overflow orizontal pe orice pagina */
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }
}

/* ═══════════════════════════════════════════
   AUTH.HTML - Fixes
   ═══════════════════════════════════════════ */
@media (max-width: 600px) {
  /* Auth box full-width pe mobil */
  .page {
    padding: 16px 12px !important;
    min-height: 100vh !important;
    align-items: flex-start !important;
    padding-top: 24px !important;
  }
  .auth-box {
    max-width: 100% !important;
    padding: 24px 18px !important;
    border-radius: 16px !important;
  }
  .ftitle {
    font-size: 18px !important;
  }
  .soc-btns {
    flex-direction: column !important;
  }
  .btn-s {
    width: 100% !important;
  }
  /* Plan cards pe mobil */
  .pc {
    padding: 12px 14px !important;
    flex-wrap: wrap !important;
  }
  .pprice {
    font-size: 18px !important;
  }
  .steps {
    flex-wrap: wrap !important;
    gap: 4px !important;
  }
  .sline {
    max-width: 16px !important;
  }
}

/* ═══════════════════════════════════════════
   DASHBOARD.HTML - Fixes
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Sidebar overlay */
  .sidebar {
    left: -240px !important;
    z-index: 999 !important;
    transition: left 0.3s ease !important;
  }
  .sidebar.open {
    left: 0 !important;
  }
  /* Fix topbar butoane */
  .topbar {
    flex-direction: column !important;
    gap: 8px !important;
    align-items: flex-start !important;
  }
  .topbar-right {
    width: 100% !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }
  .topbar-right .btn,
  .topbar-right button {
    font-size: 0.75rem !important;
    padding: 6px 10px !important;
  }
  /* Project cards grid */
  .projects-grid {
    grid-template-columns: 1fr !important;
  }
  /* Stats grid */
  .stats {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
}

@media (max-width: 480px) {
  .stats {
    grid-template-columns: 1fr !important;
  }
  .main {
    padding: 12px !important;
  }
}

/* ═══════════════════════════════════════════
   PROJECT.HTML (AI Builder) - Fixes
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Sidebar off-screen */
  .sb {
    position: fixed !important;
    top: 0 !important;
    left: -280px !important;
    width: 260px !important;
    height: 100vh !important;
    z-index: 999 !important;
    transition: left 0.3s ease !important;
    background: var(--bg2, #12121a) !important;
    border-right: 1px solid var(--brd, #27272a) !important;
  }
  .sb.open {
    left: 0 !important;
  }
  /* Chat panel full-width */
  .cp {
    width: 100% !important;
    flex: 1 !important;
    min-width: 0 !important;
  }
  /* Preview panel fullscreen overlay pe mobil */
  .rp {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 900 !important;
    background: var(--bg, #0a0a0f) !important;
  }
  .rp.mob-show {
    display: flex !important;
  }
  /* Mob toggle */
  .mob-toggle {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .mob-prev-btn {
    display: flex !important;
  }
  /* Top bar wrap */
  .topbar {
    flex-wrap: wrap !important;
    gap: 4px !important;
    padding: 6px 8px !important;
  }
  .abtns {
    flex-wrap: wrap !important;
    gap: 4px !important;
  }
  /* Page tabs hidden pe mobil (prea mici) */
  .pgsbar {
    display: none !important;
  }
  /* URL bar ascunsa */
  .urlbar {
    display: none !important;
  }
  /* Chat input adaptiv */
  .cp-input {
    padding: 8px !important;
  }
  .cp-input input,
  .cp-input textarea {
    font-size: 14px !important;
  }
}

/* ═══════════════════════════════════════════
   SOCIAL.HTML - Fixes (cele mai multe probleme)
   ═══════════════════════════════════════════ */
@media (max-width: 900px) {
  /* Sidebar off-canvas */
  .side {
    position: fixed !important;
    top: 0 !important;
    left: -280px !important;
    width: 260px !important;
    height: 100vh !important;
    z-index: 999 !important;
    transition: left 0.3s ease !important;
    box-shadow: 4px 0 20px rgba(0,0,0,.5) !important;
  }
  .side.open {
    left: 0 !important;
  }
  .main {
    margin-left: 0 !important;
    padding: 1rem !important;
  }
  .mob-toggle {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  /* Stats grid 2 coloane */
  .stats {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  /* Header actions wrap */
  .hdr-acts {
    flex-wrap: wrap !important;
    gap: 6px !important;
  }
  .hdr-acts .btn {
    font-size: 0.72rem !important;
    padding: 0.45rem 0.7rem !important;
    white-space: nowrap !important;
  }
  /* Calendar grid pe mobil - 7 coloane dar mai mici */
  .cal-grid {
    gap: 1px !important;
  }
  .cal-day {
    min-height: 55px !important;
    padding: 2px !important;
    font-size: 0.65rem !important;
  }
  .cal-hdr {
    font-size: 0.6rem !important;
    padding: 3px !important;
  }
  .cal-post {
    font-size: 0.5rem !important;
    padding: 1px 2px !important;
  }
  /* Tabel scroll horizontal */
  .tbl-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .tbl {
    min-width: 600px !important;
  }
  /* Modal responsive */
  .modal {
    max-width: 95vw !important;
    max-height: 92vh !important;
    border-radius: 12px !important;
    margin: 0 8px !important;
  }
  .modal-b {
    padding: 1rem !important;
  }
  .modal-h {
    padding: 0.8rem 1rem !important;
  }
  /* Platform checks inline */
  .plat-checks {
    flex-wrap: wrap !important;
  }
  /* AI row - stack on mobile */
  .ai-row {
    flex-direction: column !important;
    gap: 6px !important;
  }
  .ai-row input {
    width: 100% !important;
  }
  .ai-row .btn {
    width: 100% !important;
    justify-content: center !important;
  }
  /* Image style selector */
  .img-style-sel {
    flex-direction: column !important;
  }
  /* Showcase variants */
  .showcase-variants,
  .showcase-variants.on {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 4px !important;
  }
  /* Strategy cards */
  .str-kpi {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  /* Autopilot form */
  .ap-form {
    grid-template-columns: 1fr !important;
  }
  .ap-form textarea {
    grid-column: 1 !important;
  }
}

@media (max-width: 600px) {
  /* Stats 1 coloana */
  .stats {
    grid-template-columns: 1fr !important;
  }
  /* Header stack vertical */
  .hdr {
    flex-direction: column !important;
    gap: 0.75rem !important;
    align-items: flex-start !important;
  }
  .hdr h1 {
    font-size: 1.2rem !important;
  }
  .hdr-acts {
    width: 100% !important;
  }
  .hdr-acts .btn {
    flex: 1 !important;
    justify-content: center !important;
    font-size: 0.68rem !important;
    padding: 0.4rem 0.5rem !important;
  }
  /* Calendar minimal */
  .cal-day {
    min-height: 45px !important;
  }
  .cal-day .dn {
    font-size: 0.65rem !important;
  }
  /* Strategy KPIs pe 2 coloane */
  .str-kpi {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 4px !important;
  }
  /* Showcase variants - 2 coloane pe foarte mic */
  .showcase-variants,
  .showcase-variants.on {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  /* Fix: schedule row */
  .fg select,
  .fg input[type="datetime-local"] {
    font-size: 14px !important;
    min-height: 44px !important;
  }
  /* Postare modal butoane */
  .modal-f {
    flex-wrap: wrap !important;
  }
  .modal-f .btn {
    flex: 1 !important;
    justify-content: center !important;
  }
  /* Autopilot launch button */
  .ap-launch {
    width: 100% !important;
    font-size: 0.85rem !important;
    padding: 0.7rem 1rem !important;
  }
  /* Autopilot cost */
  .ap-cost {
    flex-direction: column !important;
    text-align: center !important;
    gap: 0.3rem !important;
  }
}

@media (max-width: 380px) {
  /* Foarte mic - calendar grid minuscul */
  .cal-day {
    min-height: 38px !important;
    padding: 1px !important;
  }
  .cal-hdr {
    font-size: 0.55rem !important;
  }
  .cal-post {
    display: none !important;
  }
  .cal-day .dn {
    font-size: 0.6rem !important;
  }
}

/* ═══════════════════════════════════════════
   ADS.HTML - Fixes
   ═══════════════════════════════════════════ */
@media (max-width: 900px) {
  /* Sidebar */
  .side {
    transform: translateX(-100%) !important;
    z-index: 100 !important;
  }
  .side.open {
    transform: translateX(0) !important;
  }
  .main {
    margin-left: 0 !important;
    padding: 1rem !important;
  }
  .mob-toggle {
    display: block !important;
  }
  /* Form rows stack */
  .fg-row {
    grid-template-columns: 1fr !important;
  }
  /* Platform cards */
  .plat-cards {
    grid-template-columns: 1fr !important;
  }
  /* Campaign types 2 coloane */
  .camp-types {
    grid-template-columns: 1fr 1fr !important;
  }
  /* Analysis grid */
  .analysis-grid {
    grid-template-columns: 1fr !important;
  }
  /* Header */
  .hdr {
    flex-direction: column !important;
    gap: 0.6rem !important;
    align-items: flex-start !important;
  }
  .hdr h1 {
    font-size: 1.2rem !important;
  }
  /* Table overflow */
  .tbl-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .tbl {
    min-width: 550px !important;
  }
  /* Wizard steps compact */
  .wizard-steps {
    gap: 0 !important;
  }
  .wz-num {
    width: 28px !important;
    height: 28px !important;
    font-size: 0.7rem !important;
  }
  .wz-label {
    font-size: 0.58rem !important;
  }
  .wizard-steps::before {
    top: 14px !important;
  }
  /* Modal fix */
  .modal {
    max-width: 95vw !important;
    max-height: 92vh !important;
    border-radius: 12px !important;
  }
}

@media (max-width: 600px) {
  /* Stats */
  .stats {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  /* Campaign types 1 coloana */
  .camp-types {
    grid-template-columns: 1fr !important;
  }
  /* Header butoane */
  .hdr .btn {
    width: 100% !important;
    justify-content: center !important;
    font-size: 0.75rem !important;
  }
  /* Modal body padding */
  .modal-b {
    padding: 1rem !important;
  }
  .modal-h {
    padding: 0.8rem 1rem !important;
  }
  /* Target tags */
  .target-tags {
    gap: 4px !important;
  }
  .target-tag {
    font-size: 0.65rem !important;
    padding: 2px 4px !important;
  }
}

/* ═══════════════════════════════════════════
   INDEX.HTML - Extra Fixes
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Hero visual */
  .hero-visual {
    margin-top: 1rem !important;
  }
  /* Pricing cards */
  .pricing-grid {
    grid-template-columns: 1fr !important;
  }
  /* Section padding */
  .section {
    padding: 3rem 1rem !important;
  }
  /* Hero title smaller */
  .hero-title {
    font-size: 2rem !important;
    line-height: 1.15 !important;
  }
  /* CTA buttons */
  .cta-buttons {
    flex-direction: column !important;
    align-items: center !important;
    width: 100% !important;
  }
  .cta-buttons .btn {
    width: 100% !important;
    justify-content: center !important;
  }
  /* Navbar CTA */
  .nav-cta .btn-outline {
    display: none !important;
  }
  /* Split grid */
  .split-grid,
  .split-grid.reverse {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }
  .split-grid.reverse .split-visual {
    order: 0 !important;
  }
  /* Features grid */
  .features-grid {
    grid-template-columns: 1fr !important;
  }
  /* Pain point steps */
  .pp-steps {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.6rem !important;
  }
  .hero-description {
    font-size: 0.9rem !important;
  }
  /* Hero stats */
  .hero-stats {
    flex-direction: column !important;
    gap: 0.8rem !important;
  }
  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr !important;
  }
  .footer-bottom {
    flex-direction: column !important;
    gap: 1rem !important;
    text-align: center !important;
  }
  /* Section padding ultra small */
  .section {
    padding: 2rem 0.75rem !important;
  }
  /* Pain point steps 1 col */
  .pp-steps {
    grid-template-columns: 1fr !important;
  }
  /* Video types */
  .video-types {
    grid-template-columns: 1fr !important;
  }
  /* Analytics cards */
  .analytics-cards {
    grid-template-columns: 1fr !important;
  }
  /* Updates banner */
  .updates-banner {
    grid-template-columns: 1fr !important;
  }
}

/* ═══════════════════════════════════════════
   TOUCH TARGET SIZES (toate paginile)
   Min 44px pe mobil conform guidelines Apple/Google
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Butoanele sa aiba minim 44px touchable area */
  .btn, .tab, .nav-item, button {
    min-height: 40px !important;
  }
  /* Inputs minim 44px */
  input, select, textarea {
    min-height: 42px !important;
    font-size: 16px !important; /* Previne zoom pe iOS */
  }
}

/* ═══════════════════════════════════════════
   FIX: Prevent iOS zoom on input focus
   ═══════════════════════════════════════════ */
@media screen and (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="tel"],
  input[type="url"],
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* ═══════════════════════════════════════════
   SAFE SCROLL - tabele pe mobil
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
  .tbl-wrap {
    position: relative !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  /* Scroll indicator subtle */
  .tbl-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 20px;
    background: linear-gradient(90deg, transparent, rgba(10,10,15,0.8));
    pointer-events: none;
    z-index: 1;
  }
}
