/* FAQ Styles */
.faq-item {
  border-bottom: 1px solid #f0e5ff;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
}
.faq-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.faq-question {
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  padding: 0.5rem 0;
}
.faq-question h4 {
  color: var(--primary-purple); /* Use semantic variable */
  margin: 0;
  font-size: 1rem;
  font-weight: 600; /* Make question slightly bolder */
  flex: 1;
}
.faq-question i:first-child {
  color: var(--secondary-purple); /* Use semantic variable */
  font-size: 1.2rem;
  flex-shrink: 0; /* Prevent icon from shrinking */
}
.faq-question i:last-child { /* Toggle icon */
  color: var(--secondary-purple); /* Use semantic variable */
  transition: transform 0.3s ease;
  margin-left: auto; /* Push toggle icon to the right */
}
.faq-item.active .faq-question i:last-child {
  transform: rotate(180deg);
}
.faq-answer {
  padding-left: 2.2rem; /* Aligns with text after icon (1rem gap + 1.2rem icon size) */
  color: var(--text-medium); /* Use base variable */
  font-size: 0.95rem;
  line-height: 1.6;
  display: none; /* Initially hidden */
  margin-top: 0.5rem;
}
.faq-answer p { margin-bottom: 0.5rem; } /* Spacing between paragraphs in answer */
.faq-answer p:last-child { margin-bottom: 0; }
.faq-answer strong { color: var(--primary-purple); }
.faq-answer code { background-color: #f0e5ff; padding: 0.2em 0.4em; border-radius: 3px; color: var(--primary-purple); font-family: monospace; font-size: 0.9em; }


/* CSS for Explanation Section (post-insights) */
.post-insights {
  max-width: 900px;
  margin: 3rem auto;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.post-insights a strong {
    color: #6F55FF !important;
    font-weight: 600;
}

.post-insights a:hover {
  color: #6F55FF;
  text-decoration: underline;
}

.insight-section { /* Also used for safety, related-tools, user-feedback, FAQs */
  background: white;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 25px rgba(123, 44, 191, 0.08);
  overflow: hidden; /* Important for border-radius on children */
  border: 1px solid #f0f0f0; /* Lighter border */
}
.collapsible-btn {
  background: #fff;
  color: #333;
  padding: 1.2rem 1.5rem;
  width: 100%;
  text-align: left;
  border: none;
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: background 0.3s ease;
  border-bottom: 1px solid #e0e0e0;
}
.collapsible-btn {
  transition: background 0.3s ease; /* for background smooth hover */
}

.collapsible-btn:hover {
  background: #F3F3F3;
}

@keyframes shake {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-15deg); }
  50% { transform: rotate(15deg); }
  75% { transform: rotate(-15deg); }
}

/* Base style */
.collapsible-btn i:first-child {
  font-size: 1.2rem;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

/* On hover, apply shake animation */
.collapsible-btn:hover i:first-child {
  animation: shake 0.5s ease-in-out infinite;
}

.toggle-icon { /* The down/up arrow */
  margin-left: auto;
  transition: transform 0.3s ease;
  font-size: 1.1rem; /* Adjust size if needed */
}
.collapsible-btn.active .toggle-icon {
  transform: rotate(180deg);
}
.collapsible-content {
  padding: 1.5rem 2rem; /* More padding */
  background: #fff;
  display: none; /* Controlled by JS */
  color: #333;
  font-size: 0.98rem; /* Slightly larger base font */
  line-height: 1.7;
}
.collapsible-content p,
.collapsible-content ul,
.collapsible-content ol {
  margin-bottom: 1.2rem; /* More spacing */
}
.collapsible-content p:last-child,
.collapsible-content ul:last-child,
.collapsible-content ol:last-child {
    margin-bottom: 0;
}

/* GENERAL LIST STYLING (APPLIES TO BOTH UL AND OL unless overridden) */
.collapsible-content ul,
.collapsible-content ol {
  padding-left: 1.8rem; /* Default indentation for top-level lists.
                           Custom OL numbers are positioned relative to their LIs.
                           UL bullets will use this padding. */
}

.collapsible-content li {
  position: relative;
  padding-left: 1.2rem; /* adjust space for smaller bullet */
  margin-bottom: 0.8rem;
  list-style: none;
}

.collapsible-content li::before {
  content: "";
  position: absolute;
  top: 0.6em;
  left: 0;
  width: 6px; /* sobrang liit */
  height: 6px;
  background-color: #6F55FF; /* solid purple */
  border-radius: 50%;
}



/* ORDERED LIST (OL) SPECIFIC STYLING */
.collapsible-content ol {
    list-style: none; /* Remove default numbers for custom counter */
    counter-reset: step-counter;
}
.collapsible-content ol > li { /* Target direct LI children of OL */
    padding-left: 0.5rem; /* Space for text, after custom counter is placed to its left */
}g
.collapsible-content ol > li::before {
    counter-increment: step-counter;
    content: counter(step-counter);
    background-color: #EEECF9;
    color: #6F55FF;
    font-weight: bold;
    border-radius: 50%;
    width: 1.6em;
    height: 1.6em;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 0.9em;
    position: absolute;
    left: -2.5em; /* Positioned relative to the start of the LI */
    top: 0.1em;
}

/* UNORDERED LIST (UL) SPECIFIC STYLING */
.collapsible-content ul {
    list-style-type: disc; /* Default to disc bullets for ULs */
}
/* Optional custom bullet for top-level ULs, if desired, uncomment and adjust:
.collapsible-content > ul > li::before {
    content: "•";
    color: var(--primary-purple);
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em; (Adjust this based on UL's padding-left)
} */

/* STYLING FOR NESTED LISTS */

/* UL nested inside an OL > LI (e.g., "How to Use" step sub-points) */
.collapsible-content ol > li > ul {
    list-style-type: disc !important; /* Ensure standard bullets, override if necessary */
    margin-top: 0.6rem;
    margin-bottom: 0.6rem;
    padding-left: 1.5rem; /* Indentation for this sub-UL's bullets, relative to parent LI's content flow. */
}
.collapsible-content ol > li > ul > li {
    list-style-type: disc !important; /* Ensure LI also uses disc */
    padding-left: 0; /* Reset any specific LI padding from OL context */
    margin-bottom: 0.3rem;
}
/* CRITICAL: Ensure ::before on these sub-LIs does NOT render OL numbers */
.collapsible-content ol > li > ul > li::before {
    content: "" !important;
    display: none !important;
    background: none !important;
    border-radius: 0 !important;
    width: auto !important;
    height: auto !important;
    position: static !important; /* Override absolute if it was somehow inherited */
    color: inherit !important;
    font-weight: normal !important;
    font-size: inherit !important;
    /* Add any other properties used by '.collapsible-content ol > li::before' that need explicit reset */
}

/* UL nested inside another UL (ul > ul) */
.collapsible-content ul ul {
  list-style-type: circle; /* Different bullet for deeper nesting */
  margin-top: 0.8rem;
  padding-left: 1.2rem; /* Standardized deeper indent */
}
.collapsible-content ul ul li {
  list-style-type: circle !important; /* Ensure LI uses circle */
  font-size: 0.95em;
}
/* CRITICAL: Ensure ::before on these sub-LIs does NOT render custom bullets from a parent UL if any */
.collapsible-content ul ul li::before {
    content: "" !important;
    display: none !important;
    /* Reset other properties as above if needed */
}


/* OL nested inside another OL (ol > ol) */
.collapsible-content ol ol {
    /* Keep custom numbering, but adjust appearance if needed */
    margin-top: 0.8rem;
    padding-left: 1.2rem; /* Adjust indent for nested OL */
    /* counter-reset is inherited or can be reset for different numbering style (e.g., a, b, c) */
}
.collapsible-content ol ol li {
    font-size: 0.95em;
}
.collapsible-content ol ol li::before { /* Adjust nested ordered list counter visuals */
    font-size: 0.85em; /* Smaller number */
    width: 1.5em;
    height: 1.5em;
    left: -2.2em; /* Adjust position for different padding */
    /* If you want alphabetic (a, b, c): content: counter(step-counter, lower-alpha) "."; */
}


.collapsible-content li i { /* Icons within list items (not part of list marker) */
    color: var(--secondary-purple);
    margin-right: 0.6rem;
    font-size: 1.1em;
    vertical-align: middle;
}
.collapsible-content strong {
  color: #6F55FF;
  font-weight: 700;
}
.collapsible-content code {
  background-color: var(--primary-lightest);
  padding: 0.2em 0.5em;
  border-radius: 4px;
  color: var(--primary-purple);
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9em;
  border: 1px solid #e0cffc;
}

/* Info Tip specific style */
.info-tip {
background: #f9f5ff;
border-left: 4px solid #6F55FF;
  padding: 16px 20px;
  margin: 24px 0;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap; /* for responsiveness */
}
.info-tip i {
  display: none;

}
.info-tip div {
  flex: 1;
}
.info-tip strong {
  color: #d39e00;
  display: block;
  margin-bottom: 0.3rem;
}
.info-tip p { margin: 0; line-height: 1.6; }


/* Styles for Safety Section */
.safety-section {
  padding: 2rem;
  text-align: center;
}

.safety-badge {
  background: #d9fbe3; /* lighter, fresher green background */
  color: #059c3f; /* vibrant green for text */
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 1.8rem;
  border-radius: 50px;
  font-weight: 600;
  margin-bottom: 1.5rem;
  border: 1px solid #a2f5ba; /* softened green border */
  box-shadow: 0 0 8px rgba(5, 156, 63, 0.1); /* subtle glow for positivity */
}

.safety-badge i {
  font-size: 1.2rem;
}

.safety-section h3 {
  color: var(--primary-purple);
  margin: 0 auto 2rem auto;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-align: center;
}

.safety-points {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* changed 260px to 200px */
    gap: 0.5rem;
    margin: 1.5rem 0 2rem 0;
    text-align: left;
}

.safety-point {
  background: var(--lighter-purple-bg);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}
.safety-point:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(123, 44, 191, 0.12);
  border-color: #d8bafc;
}
.safety-point i {
    color: #333;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    align-self: center;
    justify-self: center;
}

.safety-point h4 {
  color: #6F55FF;
  margin: 0 0 0.5rem 0;
  font-size: rem;
  font-weight: 700;
  text-align: center;
}

.safety-point p {
  margin: 0;
  padding: 0 1rem; /* Optional: adds space sa left and right para hindi dumikit sa edge */
  color: black;
  font-size: 0.89rem;
  line-height: 1.6;
  text-align: justify; /* This makes the text fill both left and right edges */
  display: block;
  width: 100%; /* Ensures full width */
  box-sizing: border-box; /* Includes padding in the width */
}
.terms-notice {
  background: #f9f5ff;
  border-left: 4px solid #6F55FF;
  padding: 16px 20px;
  margin: 24px 0;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap; /* for responsiveness */
}
.terms-notice i {
  display: none;

}
.terms-notice p {
  margin: 0;
  color: var(--text-medium);
  font-size: 0.9rem;
  text-align: left;
  line-height: 1.5;
}
.terms-notice a {
  color: var(--primary-purple);
  font-weight: 600;
}
.terms-notice a:hover {
  text-decoration: none;
  color: var(--secondary-purple);
}

/* Custom CSS Variables (assuming these are defined elsewhere or need to be here) */
:root {
  --primary-purple: #7B2CBF;
  --secondary-purple: #9546E8;
  --primary-lightest: #F0E5FF;
  --text-medium: #6B7280;
  /* Add other variables if you have them, e.g., --background-color */
}

/* Styles for Related Tools Section */
.related-tools {
  padding: 2.5rem 2rem;
  text-align: center;
  background-color: #faf6ff;
}

.related-tools h3 {
  color: var(--primary-purple);
  margin: 0 0 0.5rem 0;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.tools-subtitle {
  color: var(--text-medium);
  margin: 0 auto 2.5rem auto;
  font-size: 1rem;
  max-width: 600px;
  line-height: 1.6;
}

/* --- REVISED GRID LAYOUT for .tools-carousel (MAIN CHANGE HERE) --- */
.tools-carousel {
  display: grid;
  /* For PC/Desktop: Magiging 4 columns.
     grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
     Using auto-fit with minmax(200px, 1fr) helps in achieving 4 columns
     on wide screens, while allowing flexibility. */
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  padding: 1rem 0;
  justify-items: center; /* Centers the grid items within their cells */
}

/* Hide scrollbar as it's not a carousel */
.tools-carousel::-webkit-scrollbar {
  display: none;
}

/* --- HIDE ICON AND PARAGRAPH --- */
.tool-icon {
  display: none;
}
.tool-card p {
  display: none;
}

/* --- TOOL CARD STYLES (FIXED SIZE, CARD LOOK, ADJUSTED FOR COMPACTNESS) --- */
.tool-card {
  background: white; /* White background */
  border: 1px solid #e5d9f2; /* Border */
  border-radius: 12px; /* Rounded corners */
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05); /* Soft shadow */
  padding: 1rem 0.8rem; /* Adjusted padding for title and button only, more compact */
  border-color: var(--primary-purple); /* Border color change on hover */

  
  /* Fixed height for consistent card size */
  height: 120px; /* Adjust this value as needed for your desired fixed height */
  /* Fixed width within its grid cell */
  width: 100%; /* Make card fill its grid column */
  max-width: 240px; /* Optional: Sets a maximum width for the card if grid column gets too wide */
  
  /* Flexbox properties to center content */
  display: flex;
  flex-direction: column;
  align-items: center;     /* Centers title and button horizontally */
  justify-content: center; /* Vertically centers content within the fixed height */
  gap: 0.6rem;             /* Spacing between title and button */
  
  transition: all 0.3s ease; /* Keep transition for hover effects */
}

/* Restore card hover effects */
.tool-card:hover {
  transform: translateY(-6px) scale(1.02); /* Lift and slightly scale */
  box-shadow: 0 10px 30px rgba(123, 44, 191, 0.15); /* Stronger shadow on hover */
  border-color: var(--primary-purple); /* Border color change on hover */
}

/* --- TITLE STYLES (TEXT SHRINKING/WRAPPING) --- */
.tool-card h4 {
  color: var(--primary-purple);
  margin: 0; /* Remove default margin */
  font-weight: 600;
  text-align: center; /* Ensure title is centered */
  
  /* --- TEXT SHRINKING / MULTI-LINE LOGIC --- */
  /* Clamp for font size: Will scale font size based on viewport width,
     but limited between 0.9rem and 1.15rem */
  font-size: clamp(0.9rem, 3.5vw, 1.15rem);
  
  /* Limit to 2 lines, then add ellipsis if overflows vertically */
  display: -webkit-box;
  -webkit-line-clamp: 2; /* Limit to 2 lines */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis; /* Add "..." if content overflows */
  
  /* Ensure a minimum height for the title, even if it's one short word,
     to keep the button position consistent */
  min-height: 2.2em; /* Approximately enough for 2 lines at smaller font sizes */
}

/* BUTTON STYLES (UNCHANGED) */
.tool-btn {

  background: #E0E0E0;
  color: var(--primary-purple);
  border: 1px solid transparent;
  border-radius: 50px;
  padding: 0.85rem 1.8rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  text-decoration: none;
  align-self: center; /* Keep this to center the button horizontally within flex column */
  border-color: var(--primary-purple); /* Border color change on hover */

}

.tool-btn:hover {
  background: var(--primary-purple);
  color: white;
  box-shadow: 0 5px 15px rgba(123, 44, 191, 0.25);
  border-color: var(--primary-purple);
  transform: translateY(-2px);
}

.tool-btn i {
  font-size: 1rem;
  transition: transform 0.3s ease;
}

.tool-btn:hover i {
  transform: translateX(4px);
}

@media (min-width: 1200px) {
    .tools-carousel {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}

/* For medium screens (e.g., tablets, smaller laptops): 3 columns */
@media (max-width: 1199px) and (min-width: 769px) {
    .tools-carousel {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
}

/* For smaller tablets and large phones (TARGET FOR 2 COLUMNS, START OF SHRINKING) */
@media (max-width: 768px) {
.tool-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
    gap: 0.4rem;
  }
    .tools-carousel {
        grid-template-columns: repeat(2, 1fr); /* Always 2 columns */
        gap: 10px; /* Smaller gap */
    }
    .tool-card-explore {
        padding: 10px; /* Smaller padding inside card */
    }
    .tool-card-explore .tool-name {
        font-size: 0.85rem; /* Smaller font for tool name */
        margin-bottom: 8px;
        /* Pwede kang mag-limit ng lines kung kailangan */
        /* display: -webkit-box; 
           -webkit-line-clamp: 2; 
           -webkit-box-orient: vertical;
           overflow: hidden; 
           text-overflow: ellipsis;
           min-height: 2.4em;  (approx 2 lines based on font-size and line-height) */
    }
    .tool-card-explore .try-tool-button {
        font-size: 0.75rem; /* Smaller font for button */
        padding: 6px 10px; /* Smaller padding for button */
    }
}

/* For MOST mobile screens (e.g., 375px to 480px width - STILL 2 COLUMNS, FURTHER SHRINKING) */
@media (max-width: 480px) {
.tool-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
    gap: 0.4rem;
  }
    .tools-carousel {
        grid-template-columns: repeat(2, 1fr); /* Still 2 columns */
        gap: 8px; /* Even smaller gap */
    }
    .tool-card-explore {
        padding: 8px; /* Even smaller padding inside card */
        border-radius: 8px; /* Pwedeng mas maliit na radius */
    }
    .tool-card-explore .tool-name {
        font-size: 0.78rem; /* Slightly smaller again */
        margin-bottom: 6px;
        /* min-height: 2.2em; */ /* Adjust if limiting lines */
    }
    .tool-card-explore .try-tool-button {
        font-size: 0.7rem; /* Slightly smaller button text */
        padding: 5px 8px; /* Smaller button padding */
    }

}

/* Fallback for EXTREMELY tiny screens (e.g., below 360px or 320px) - Single Column */
/* Mahalaga pa rin itong fallback para sa usability */
@media (max-width: 359px) { 
    .tools-carousel {
        grid-template-columns: 1fr; /* Fallback to 1 card per row */
        gap: 12px;
    }
    .tool-card-explore {
        padding: 12px; /* Pwedeng ibalik sa medyo mas malaking padding */
        max-width: 280px; /* Optional: limit card width for better centering */
        margin-left: auto;
        margin-right: auto;
    }
    .tool-card-explore .tool-name {
        font-size: 0.9rem; /* Pwedeng ibalik sa medyo mas malaking font */
    }
    .tool-card-explore .try-tool-button {
        font-size: 0.8rem; /* Pwedeng ibalik sa medyo mas malaking font */
    }
}


/* Responsive adjustments for explanation section */
@media (max-width: 768px) {
    .post-insights { margin: 2rem auto; }
    .collapsible-content { padding: 1.5rem; font-size: 0.95rem; }
    /* .collapsible-content ol li::before { left: -2.2em; } */ /* Let specific OL rule handle this */
    .safety-section, .related-tools, .user-feedback { padding: 2rem 1.5rem; }
    .safety-points { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .collapsible-btn { font-size: 1rem; padding: 1rem 1.2rem; }
    .collapsible-content { padding: 1.2rem; }
    /* .collapsible-content ol { padding-left: 2rem; } */ /* Let specific OL rule handle this */
    /* .collapsible-content ol li::before { left: -2.8em; } */ /* Let specific OL rule handle this */
    .safety-section, .related-tools, .user-feedback { padding: 1.5rem 1rem; }
    .safety-badge { padding: 0.5rem 1.2rem; font-size: 0.9rem;}
    .safety-section h3 { font-size: 1.3rem; }
}
