/*
 * ============================================================
 * GLOBAL RESPONSIVE STYLESHEET — myperfectresumee
 * Covers: Mobile (≤576px), Tablet (≤768px / ≤992px), Desktop
 * ============================================================
 */

/* ── Base: prevent horizontal overflow everywhere ── */
html, body {
  overflow-x: hidden;
  width: 100%;
}

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

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

/* ── Container padding on small screens ── */
.container, .container-fluid {
  padding-left: clamp(12px, 4vw, 24px);
  padding-right: clamp(12px, 4vw, 24px);
  width: 100%;
}

/* ================================================================
   ABOUT PAGE
   ================================================================ */
.about-hero .hero-title,
.about-hero h1 {
  font-size: clamp(1.75rem, 5vw, 3.5rem);
}

.about-hero .hero-subtitle,
.about-hero p {
  font-size: clamp(0.95rem, 2.5vw, 1.25rem);
}

@media (max-width: 991.98px) {
  .about-hero {
    padding: 2rem 0 1.5rem;
    min-height: 260px;
  }
  .about-hero .container {
    text-align: center;
  }
}

@media (max-width: 767.98px) {
  .about-hero {
    padding: 1.5rem 0 1rem;
    min-height: 200px;
  }
}

/* About team/stats grid */
@media (max-width: 767.98px) {
  .about-stats-grid,
  .stats-row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px !important;
  }
  .team-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  .about-stats-grid,
  .stats-row {
    grid-template-columns: 1fr !important;
  }
}

/* ================================================================
   TEMPLATES PAGE
   ================================================================ */
@media (max-width: 991.98px) {
  .templates-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 32px;
  }
  .templates-header-content {
    min-width: 100%;
  }
  .templates-title {
    font-size: 2rem;
  }
  .templates-filter-wrapper {
    width: 100%;
  }
  .template-filter {
    width: 100%;
    min-width: unset;
  }
}

@media (max-width: 767.98px) {
  .templates-section {
    padding: 60px 0;
  }
  .templates-title {
    font-size: 1.75rem;
  }
  .templates-subtitle {
    font-size: 1rem;
  }
  .templates-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important;
    gap: 20px !important;
  }
}

@media (max-width: 575.98px) {
  .templates-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .templates-section {
    padding: 40px 0;
  }
}

/* ================================================================
   PRICING PAGE (standalone pricing.php)
   ================================================================ */
@media (max-width: 1100px) {
  .pricing-section .pricing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 767.98px) {
  .pricing-section .pricing-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
  .pricing-section .pricing-card-featured {
    transform: scale(1) !important;
  }
  .pricing-section .pricing-title {
    font-size: clamp(1.6rem, 5vw, 2rem) !important;
  }
  .pricing-section {
    padding: 40px 20px !important;
  }
}

/* ================================================================
   FEATURES PAGE
   ================================================================ */
@media (max-width: 575.98px) {
  .features-section {
    padding: 60px 0;
  }
  .features-header {
    margin-bottom: 40px;
  }
  .features-main-title {
    font-size: 1.6rem;
  }
  .features-subtitle {
    font-size: 0.95rem;
  }
  .features-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .feature-card {
    padding: 24px 20px !important;
  }
  .btn-features-primary,
  .btn-features-secondary {
    width: 100%;
    text-align: center;
    padding: 14px 24px;
  }
}

/* ================================================================
   HOW IT WORKS / STEPS
   ================================================================ */
@media (max-width: 575.98px) {
  .step-card {
    padding: 30px 20px !important;
    max-width: 100% !important;
  }
  .step-title {
    font-size: 1.125rem !important;
  }
  .step-description {
    font-size: 0.9rem !important;
  }
}

/* ================================================================
   FAQ PAGE / SECTION
   ================================================================ */
@media (max-width: 767.98px) {
  .faq-homepage-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
  .faq-homepage-title {
    font-size: clamp(1.6rem, 5vw, 2.25rem) !important;
  }
}

/* ================================================================
   CONTACT PAGE
   ================================================================ */
@media (max-width: 767.98px) {
  .contact-grid,
  .contact-wrapper {
    grid-template-columns: 1fr !important;
  }
  .contact-info,
  .contact-form-wrapper {
    width: 100% !important;
  }
}

/* ================================================================
   SOP BUILDER / EDITOR PAGES
   ================================================================ */
@media (max-width: 991.98px) {
  .sop-editor-layout,
  .sop-wrapper {
    flex-direction: column !important;
    gap: 20px;
  }
  .sop-sidebar {
    width: 100% !important;
    max-width: 100% !important;
  }
  .sop-preview {
    width: 100% !important;
  }
}

@media (max-width: 767.98px) {
  .sop-style .container {
    padding: 0 12px !important;
  }
}

/* ================================================================
   RESUME EDITOR / CREATE-RESUME
   ================================================================ */
@media (max-width: 991.98px) {
  .resume-editor-wrapper,
  .editor-layout {
    flex-direction: column !important;
  }
  .editor-sidebar,
  .form-panel {
    width: 100% !important;
    max-width: 100% !important;
  }
  .preview-panel {
    width: 100% !important;
    overflow-x: auto;
  }
}

/* ================================================================
   LOGIN & REGISTER PAGES
   ================================================================ */
@media (max-width: 575.98px) {
  .login-card,
  .register-card {
    padding: 24px 20px !important;
    border-radius: 12px !important;
    margin: 0 8px;
  }
  .login-brand-logo {
    width: min(180px, 60%) !important;
  }
}

/* ================================================================
   TABLE — prevent overflow on small screens
   ================================================================ */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 0;
}

@media (max-width: 767.98px) {
  table td, table th {
    font-size: 0.85rem;
    padding: 0.5rem 0.6rem;
    white-space: nowrap;
  }
}

/* ================================================================
   GENERAL TEXT & TYPOGRAPHY — fluid scaling
   ================================================================ */
h1 { font-size: clamp(1.75rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.75rem); }
h3 { font-size: clamp(1.25rem, 3vw, 2rem); }
h4 { font-size: clamp(1.1rem, 2.5vw, 1.5rem); }

p {
  word-break: break-word;
  overflow-wrap: break-word;
}

/* ================================================================
   BUTTONS — full width on mobile
   ================================================================ */
@media (max-width: 575.98px) {
  .hero-cta-group .hero-btn,
  .features-cta .btn-features-primary,
  .features-cta .btn-features-secondary {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
}

/* ================================================================
   GRID UTILITIES — auto-collapse
   ================================================================ */
@media (max-width: 767.98px) {
  .row > [class^="col-md"],
  .row > [class^="col-lg"] {
    width: 100%;
  }
  .g-4 {
    gap: 1rem !important;
  }
}

/* ================================================================
   SECTION SPACING — tighter on small screens
   ================================================================ */
@media (max-width: 767.98px) {
  section, .section {
    padding-top: clamp(40px, 8vw, 80px);
    padding-bottom: clamp(40px, 8vw, 80px);
  }
}

@media (max-width: 575.98px) {
  section, .section {
    padding-top: clamp(32px, 6vw, 60px);
    padding-bottom: clamp(32px, 6vw, 60px);
  }
}

/* ================================================================
   CARD GRIDS — auto-adapt to screen
   ================================================================ */
.resources-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
}

@media (max-width: 767.98px) {
  .resources-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
}

/* ================================================================
   NAVBAR — ensure logo doesn't overflow
   ================================================================ */
@media (max-width: 360px) {
  .navbar-brand img {
    height: 30px !important;
  }
  .brand-text {
    font-size: 0.9rem !important;
  }
}

/* ================================================================
   FOOTER — grid fix on mobile
   ================================================================ */
@media (max-width: 575.98px) {
  .site-footer .row {
    gap: 1.5rem;
  }
  .site-footer .row > div {
    padding-bottom: 0 !important;
  }
}

/* ================================================================
   MODALS — full width on mobile
   ================================================================ */
@media (max-width: 575.98px) {
  .modal-dialog {
    margin: 8px;
    max-width: calc(100vw - 16px);
  }
  .modal-content {
    border-radius: 12px;
  }
}

/* ================================================================
   PREVENT LONG STRINGS / LINKS FROM BREAKING LAYOUT
   ================================================================ */
a, span, td, li {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* ================================================================
   SCROLLABLE CONTAINERS — horizontal scroll with touch
   ================================================================ */
.overflow-x-auto,
[class*="scroll-x"] {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
