/*
=================================================================
  --- 1. ROOT VARIABLES & GLOBAL STYLES (Mobile-First) ---
=================================================================
*/


:root {
  --primary-bg: #FAFAFA;
  --primary-blue: #001430;
  --accent-gold: #d4af37;
  --white: #FFFFFF;
  --shadow-color: rgba(0, 20, 48, 0.1);
  --transition: all 0.3s ease;
  --border-radius: 10px;
  --cta-border-radius: 10px;
  --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --primary-color: #001430;
  --secondary-color: #d4af37;
  --accent-color: #4a90e2;
  --text-color: #001430;
  --light-text: #ffffff;
  --light-bg: #fafafa;
}

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

html, body {
  width: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--primary-bg);
  color: var(--primary-blue);
  line-height: 1.6;
  letter-spacing: normal;
}



.container {
  width: 100%;
  margin: 0 auto;
  padding: 0; /* Padding for mobile */
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
}

main {
  padding: 0;
  width: 100%;
}

/* Accessibility improvements */
.btn:focus, .nav-link:focus, .form-input:focus, .form-textarea:focus, .template-button:focus, .back-button:focus {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
}

/* Animation for page transitions */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.tool-section.active, .lead-magnet-view.active {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes bounce {
  0%   { transform: translateY(0); }
  30%  { transform: translateY(-5px); }
  60%  { transform: translateY(2px); }
  100% { transform: translateY(0); }
}

/*
=================================================================
  --- 2. HEADER & NAVIGATION (Mobile-First) ---
=================================================================
*/


/*
=================================================================
  --- 3. PAGE-SPECIFIC SECTIONS (Mobile-First) ---
=================================================================
*/

/* --- SmartHub Title Section --- */
.smarthub-title-header {
  background-color: var(--primary-blue);
  color: var(--white);
  padding: 20px 15px 30px;
  box-shadow: 0 4px 6px var(--shadow-color);
  width: 100%;
  text-align: center;
}

.logo-container {
  display: flex;
  justify-content: center;
  margin-top: 80px;
}

.logo-container .logo {
  width: 220px;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.smarthub-title-header h1 {
  font-size: 2rem;
  margin-top: 20px;
  font-weight: 700;
}

.smarthub-title-header .subtitle {
  font-size: 1.1rem;
  font-weight: 600;
  opacity: 0.9;
  margin-top: 20px;
  margin-bottom: 30px;
}

/* --- Main Nav Tabs --- */
.main-nav {
  display: contents;
  justify-content: center;
  margin-top: 20px;
}

.nav-tabs {
  display: flex;
  justify-content: center;
  list-style: none;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: none;
}

.nav-item {
  margin: 0;
  width: 100%;
}

.nav-tabs .nav-link {
  display: block;
  padding: 12px;
  color: var(--white);
  text-decoration: none;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  font-size: 1.1rem;
  text-align: center;
}

.nav-tabs .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.nav-tabs .nav-link.active {
  background-color: var(--accent-gold);
  color: var(--primary-blue) !important;
  border-color: var(--accent-gold);
}

.nav-tabs .nav-link.active::after {
  display: none; /* Hidden on mobile */
}

/* --- Search & Content Sections --- */
.search-container {
  margin: 30px auto;
  width: 90%;
  max-width: 700px;
}

#searchInput {
  width: 100%;
  padding: 15px 25px;
  font-size: 16px;
  border: 2px solid var(--primary-blue);
  border-radius: 30px;
  background-color: var(--white);
  transition: var(--transition);
  box-shadow: 0 2px 5px var(--shadow-color);
}

#searchInput:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 20, 48, 0.2);
}

.tool-section { display: none; }
.tool-section.active { display: block; }
.pdf-card.hidden, .category-section.hidden { display: none; }

.category-section {
  margin: 0px auto; /* Changed from "20px 0" to center the container */
  background-color: var(--white);
  border-radius: 0;
  padding: 20px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  width: 95%; /* Ensures 90% width on all screens */
  max-width: 1100px; /* Prevents it from getting too wide on large screens */
}

.category-section h2 {
  color: var(--primary-blue);
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 20px;
  padding: 10px;
  border-bottom: 2px solid var(--accent-gold);
  text-align: center;
}

.pdf-grid {
  display: grid;
  gap: 15px;
  grid-template-columns: 1fr; /* Single column on mobile */
  padding: 15px;
}

.pdf-card {
  background-color: var(--white);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 5px var(--shadow-color);
  transition: var(--transition);
  border: 1px solid rgba(0, 20, 48, 0.1);
  display: flex;
  flex-direction: column;
}

.pdf-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px var(--shadow-color);
}

.pdf-icon {
  width: 50px;
  height: 50px;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

.pdf-icon i { color: var(--accent-color); }

.pdf-card h3 {
  font-size: 1.2rem;
  margin-bottom: 15px;
  color: var(--primary-blue);
  flex-grow: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pdf-card h3 i {
  color: var(--primary-color);
  font-size: inherit;
}

.pdf-actions {
  display: flex;
  gap: 10px;
}

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 5px;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition);
  text-align: center;
  flex: 1;
  cursor: pointer;
  border: none;
}

.btn.btn-download {
  background-color: var(--secondary-color);
  color: var(--primary-color);
}
.btn.btn-download:hover { background-color: #c99b16; }

.btn i { margin-right: 8px; }

/*
=================================================================
  --- 4. LEAD MAGNET GENERATOR (Mobile-First) ---
=================================================================
*/
.lead-magnet-container { padding: 0px; }
.lead-magnet-view { display: none; }
.lead-magnet-view.active { display: block; }

.intro-section {
  text-align: center;
  margin-bottom: 40px;
}

.intro-description {
  max-width: 800px;
  margin: 0 auto;
  color: #555;
  font-size: 1.1rem;
  line-height: 1.7;
}

.template-grid {
  display: grid;
  grid-template-columns: 1fr; /* Single column on mobile */
  gap: 15px;
  margin-bottom: 30px;
}

.template-card {
  background-color: var(--white);
  border-radius: var(--border-radius);
  border: 1px solid rgba(0, 20, 48, 0.1);
  box-shadow: var(--box-shadow);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  transition: var(--transition);
  padding: 20px;
}

.template-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px var(--shadow-color);
}

.template-image {
  align-items: center;
  background-color: #f0f0f0;
  border-bottom: 1px solid #eee;
  display: flex;
  height: 180px;
  justify-content: center;
  width: 100%;
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
}

 img.template-icon {
  max-width: 100px;
  max-height: 100px;
  width: auto;
  height: auto;
  margin-bottom: 0;
  margin-left: 0;
  align-self: center;
}

.template-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-grow: 1;
  padding: 25px;
 
}

.template-title {
  color: var(--primary-blue);
  display: flex;
  justify-content: center;
  gap: 10px;
  font-size: 1.3rem;
  font-weight: 600;
  margin: 15px;
  font-family: 'Poppins', sans-serif;
}

.template-title i { color: var(--accent-gold); }

.template-description {
  color: #001430;
  font-family: 'Poppins', sans-serif;
  flex-grow: 1;
  font-size: 0.95rem;
  margin-bottom: 20px;
text-align:center;
}

.template-button {
  align-items: center;
  background-color: var(--accent-gold);
  border: none;
  border-radius: var(--cta-border-radius);
  color: var(--primary-blue);
  cursor: pointer;
  display: flex;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  gap: 8px;
  justify-content: center;
  margin-top: auto;
  padding: 12px 18px;
  transition: var(--transition);
  width: 100%;
}

.template-button:hover { background-color: #c99b16; }

.catagory-section h2{
padding: 10px;
margin-bottom: 20px;
}

.editor-header {
  display: flex;
  flex-direction: column; 
  align-items: flex-start;
  gap: 20px;   
  border-bottom: 1px solid #eee;
  margin-bottom: 30px;
  padding-bottom: 20px;
}

.editor-title-wrapper {
  display: flex;
  flex-wrap: wrap; /* KEY FIX: Allows proper wrapping */
  align-items: baseline;
  gap: 0.5em; /* Space between "Customise Your" and template name */
  line-height: 1.4; /* Better spacing when wrapped */
}

.title-static-part,
.title-dynamic-part {
  color: var(--primary-blue);
  font-weight: 600;
  font-size: 1.5rem; /* Mobile font size - applied directly to text */
}

.title-static-part {
  display: flex;
  align-items: center;
  gap: 10px; /* Space between icon and text */
}

.editor-form {
  width: 100%;
  margin-bottom: 30px;
}

.editor-title i { color: var(--accent-gold); }

.form-group { margin-bottom: 25px; }

.form-label {
  color: var(--primary-blue);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 8px;
}

.form-label i {
  color: var(--accent-gold);
  font-size: 0.9rem;

}

.form-input, .form-textarea {
  background-color: #fdfdfd;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  padding: 15px 18px;
  transition: var(--transition);
  width: 100%;
}

.form-input:focus, .form-textarea:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
  outline: none;
}

.form-textarea {
  min-height: 150px;
  resize: vertical;
}

.color-options {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 10px;
}

.color-option {
  border: 3px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  height: 35px;
  transition: var(--transition);
  width: 35px;
}

.color-option.selected {
  border-color: var(--accent-gold);
  transform: scale(1.1);
}

.preview-container {
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: var(--border-radius);
  margin-top: 30px;
  margin-right: auto;
  margin-left: auto;
  width: 100%;
}

.preview-header { 
  margin-bottom: 20px; 
  margin-top: 20px; 
  margin-left: 20px; 
}

.preview-title {
  color: var(--primary-blue);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.3rem;
  font-weight: 600;
}

.preview-title i { 
color: var(--accent-gold); 
}

.preview-content {
  background-color: var(--white);
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  min-height: 300px;
  padding: 20px;
  transition: var(--transition);
}

.action-buttons {
  display: flex;
  flex-direction: column; /* Stacked on mobile */
  justify-content: flex-end;
  gap: 10px;
  margin-top: 30px;
}

.primary-button, .secondary-button {
  align-items: center;
  border: none;
  border-radius: var(--cta-border-radius);
  cursor: pointer;
  display: flex;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  gap: 8px;
  padding: 12px 25px;
  transition: var(--transition);
  width: 100%; /* Full width on mobile */
  justify-content: center;
}

.primary-button {
  background-color: var(--accent-gold);
  color: var(--primary-blue);
}
.primary-button:hover {
  background-color: #c99b16;
  transform: translateY(-2px);
}

.secondary-button {
  background-color: #e9ecef;
  color: #333;
}
.secondary-button:hover { background-color: #dee2e6; }

.back-button {
  background-color: #f0f0f0;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Poppins', sans-serif;
  padding: 10px 18px;
  transition: var(--transition);
}
.back-button:hover { background-color: #e0e0e0; }

/* ==========================================================================
   Lead Capture Modal (For Tool Suite Downloads)
   ========================================================================== */

/* Helper class added via JS to lock the background page scroll */
body.modal-open {
    overflow: hidden;
}

/* 1. The Modal Overlay (Lighter Background) - This is perfect, no changes needed. */
.tool-suite-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 20, 48, 0.2); /* Lighter overlay */
    animation: fadeIn 0.3s ease-out;
    align-items: center;
    justify-content: center;
}

/* 2. The Modal Content Box (the white container) */
.tool-suite-modal .modal-content {
    position: relative;
    background-color: #e1e1e1;
    margin: 1rem; 
    width: 90%; 
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.4);
    animation: slideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;    
    max-height: 95vh; 
}

.tool-suite-modal .modal-body {
    padding: 1.5rem;
   background-color: #fafafa;
    overflow-y: auto; /* This will now work correctly */
    -webkit-overflow-scrolling: touch; /* For smooth mobile scrolling */
}

/* 
  4. The Modal Header (You'll need this too)
  We need to make sure the header doesn't shrink.
*/
.tool-suite-modal .modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0; /* This prevents the header from being squished */
    background-color: #eee;
}

.tool-suite-modal .modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: #001430; /* Your primary color */
}

.tool-suite-modal .close-button {
    color: #6b7280;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.tool-suite-modal .close-button:hover {
    color: #000;
}

/* 4. The Modal Body (The scrollable form area) */
.tool-suite-modal .modal-body {
    padding: 1.5rem;
    overflow-y: auto; /* This is the magic: adds a scrollbar ONLY when needed */
    background-color: #fafafa;
}

.tool-suite-modal .modal-body p {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    color: #333;
}

/* 5. Form Element Styling */
.tool-suite-modal .form-group {
    margin-bottom: 1rem;
}

.tool-suite-modal .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #001430;
}

.tool-suite-modal .form-group input[type="text"],
.tool-suite-modal .form-group input[type="email"],
.tool-suite-modal .form-group input[type="tel"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.tool-suite-modal .form-group input:focus {
    border-color: #d4af37; /* Your secondary color */
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.3);
    outline: none;
}

.tool-suite-modal .privacy-group {
    display: flex;
    align-items: flex-start; /* Align to top for multi-line text */
    gap: 0.75rem;
}

.tool-suite-modal .privacy-group input[type="checkbox"] {
    margin-top: 0.2em; /* Align checkbox with first line of text */
    flex-shrink: 0;
}

.tool-suite-modal .privacy-group label {
    font-weight: normal;
    font-size: 0.85rem;
    margin-bottom: 0;
    line-height: 1.4;
}

.tool-suite-modal .g-recaptcha {
    margin: 1.5rem 0;
    display: flex;
    justify-content: center;
}

.tool-suite-modal #modal-submit-btn {
    width: 100%;
    padding: 0.8rem;
    font-size: 1rem;
}

/* Style for the message display area in the modal */
.tool-suite-modal .modal-body .error-message {
    color: #D8000C; /* Red for errors */
    background-color: #FFD2D2;
    padding: 0.75rem;
    border-radius: 5px;
    margin-top: 1rem;
    text-align: center;
    display: block; /* Ensure it's visible */
}

.tool-suite-modal .modal-body .success-message {
    color: #270; /* Dark green for success */
    background-color: #DFF2BF;
    padding: 0.75rem;
    border-radius: 5px;
    margin-top: 1rem;
    text-align: center;
    display: block; /* Ensure it's visible */
}

/* Initially, the message container should be empty and have no styles */
#modal-error-msg:empty {
    display: none;
}


/* Animations (No changes needed here) */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/*
=================================================================
  --- 5. FOOTER (Mobile-First) ---
=================================================================
*/


/*
=================================================================
  --- 6. RESPONSIVE STYLES (Tablet Breakpoint) ---
=================================================================
*/
@media (min-width: 768px) {


  .smarthub-title-header {
    padding: 90px 20px 40px;
  }
 
  .search-container {
    width: 80%;
  }

  .category-section {
    border-radius: 8px;
    padding: 20px;
  }
  .category-section h2 {
    font-size: 1.8rem;
  }

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

  .nav-tabs {
    flex-wrap: nowrap;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    padding-bottom: 5px;
  }
  .nav-item {
    width: auto;
    margin: 0 5px;
  }
  .nav-tabs .nav-link {
    padding: 10px 18px;
    font-size: 1rem;
    border: none;
    border-radius: 5px 5px 0 0;
  }
  .nav-tabs .nav-link.active::after {
    display: block;
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 5px;
    background-color: var(--accent-gold);
  }

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}


  /* 1. Change the main header to a horizontal layout */
  .editor-header {
    flex-direction: column;    
    justify-content: space-between; 
    align-items: center;     
    gap: 20px;               
  }

  /* 2. Change the title wrapper to a horizontal layout */
  .editor-title-wrapper {
    flex-direction: row;      
    align-items: baseline;  
    max-width: 90%;  
    gap: 0.5em;             
   }

  /* 3. Remove the mobile-only padding from the dynamic part */
  .title-dynamic-part {
    padding-left: 0; 
  }
    .tool-suite-modal .modal-content {
        /* On larger screens, we can have a smaller max-width */
        max-width: 500px; 
        /* On larger screens, we have more vertical space, so we can reduce the max-height */
        max-height: 90vh;
    }
}

/*
=================================================================
  --- 7. RESPONSIVE STYLES (Desktop Breakpoint) ---
=================================================================
*/

@media (min-width: 952px) {
  .smarthub-title-header h1 {
  font-size: 3rem;
  margin-top: 20px;
  font-weight: 700;
}

.smarthub-title-header .subtitle {
  font-size: 1.3rem;
  font-weight: 700;
  opacity: 0.9;
  margin-top: 20px;
  margin-bottom: 30px;
}
.smarthub-title-header {
  background-color: var(--primary-blue);
  color: var(--white);
  padding: 20px 15px 30px;
  box-shadow: 0 4px 6px var(--shadow-color);
  width: 100%;
  text-align: center;
}

.logo-container {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
  margin-top: 100px;
}

.logo-container .logo {
  width: 280px;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.pdf-grid {
  grid-template-columns: repeat(2, 1fr); 
  gap: 30px;
}

.nav-tabs .nav-link {
  padding: 12px 24px;
  font-size: 1.1rem;
}

.editor-header {
  flex-direction: column;
  align-items: center;
}
.editor-title {
   font-size: 1.8rem;
}
.action-buttons {
  flex-direction: row;
}
.primary-button, .secondary-button {
  width: auto;
}

  /* We can increase the font size for better readability on large screens */
  .title-static-part,
  .title-dynamic-part {
    font-size: 1.75rem; /* Increase font size from 24px to 28px */
  }

  /* Optional: Increase the gap between the icon and text if needed */
  .title-static-part {
    gap: 12px;
  }

  #lead-capture-modal .modal-content { max-height: 95vh; width: 95%;}
}


@media (min-width: 1150px){
.pdf-grid {
  grid-template-columns: repeat(3, 1fr); 
  gap: 30px;
}
}