/* File: static/css/custom_header.css (Corrected) */

/* --- General Header Styling --- */
body { padding-top: 76px; }
/* Prevent body scrolling when overlay/menu is open */
body.no-scroll { overflow: hidden; }


.site-header { position: fixed; top: 0; left: 0; width: 100%; height: 76px; background-color: #fff; z-index: 3050; border-bottom: 3px solid #4d73c0; box-shadow: 0 2px 4px rgba(0,0,0,0.05); display: flex; align-items: center; }
.navbar-content { display: grid; grid-template-columns: auto minmax(0,1fr) auto; column-gap: clamp(1.1rem,2vw,2.5rem); align-items: center; width: 100%; }

/* --- Logo Styling (Apply to both header and footer logos) --- */
.navbar-logo a, .footer-logo a { display: flex; align-items: center; padding: 0; }

.navbar-logo svg, .footer-logo svg {
    max-width: 200px; /* Default max width for desktop */
    height: auto;    /* Maintain aspect ratio */
    max-height: 88px; /* Default max height for desktop */
}

/* Imported raster logo (replaces the inline SVG wordmark in the header) */
.navbar-logo .site-logo {
    height: 46px;
    width: auto;       /* keep 640x233 aspect ratio */
    max-height: 60px;
    display: block;
}
@media (max-width: 1199.98px) {
    .navbar-logo .site-logo { height: 40px; }
}

/* Ensure the image inside the SVG scales correctly */
.navbar-logo svg image, .footer-logo svg image {
    width: 100%;
    height: 100%;
}


/* --- Main Links --- */
.navbar-main-links { position: static; min-width: 0; display: flex; align-items: center; justify-content: center; gap: clamp(.7rem,1.05vw,1.05rem); }
.navbar-main-links .nav-link { padding: .45rem .1rem; color: #333 !important; font-size: .94rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.navbar-main-links .nav-link:hover { color: #4d73c0 !important; }
.navbar-main-links .nav-link.active { color: #375891 !important; font-weight: 700; }
.navbar-main-links .nav-link-templates { color: #375891 !important; }
.navbar-main-links .nav-link-templates:hover { color: #24477f !important; }
.navbar-main-links .nav-link-ai { color: #7c3aed !important; font-weight: 700; }
.navbar-main-links .nav-link-ai:hover { color: #6b2fd1 !important; }
.navbar-main-links .nav-link-ai .fa-wand-magic-sparkles { color: #7c3aed; }

/* MODIFIED: Styling for the Tools button and its arrow */
.tools-dropdown-toggle { display: flex; align-items: center; gap: 0.42rem; border: 0; background: transparent; }
.tools-dropdown-toggle .fa-chevron-down { transition: transform 0.3s ease; font-size: 0.8em; }
/* When menu is OPEN, color the button text and flip the arrow up */
.tools-dropdown-toggle[aria-expanded="true"] { color: #4d73c0 !important; }
.tools-dropdown-toggle[aria-expanded="true"] .fa-chevron-down { transform: rotate(180deg); }

.tools-dropdown-toggle::after {
    display: none;
}


/* --- Auth Links --- */
.navbar-auth-links { display: flex; align-items: center; justify-content: flex-end; gap: .8rem; white-space: nowrap; }
.navbar-auth-links .btn-site-search { display: inline-grid; place-items: center; width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%; background: #f3f5fa; color: #43516a; font-weight: 650; text-decoration: none; }
.navbar-auth-links .btn-site-search:hover, .navbar-auth-links .btn-site-search.active { color: #365da9; }
.navbar-auth-links .btn-login { font-weight: 600; color: #333; text-decoration: none; }
.navbar-auth-links .btn-login:hover { color: #4d73c0; }
.navbar-auth-links .btn-free-trial { background-color: #4d73c0; color: white; padding: 0.65rem 1rem; border-radius: 7px; font-size: .9rem; font-weight: 700; text-decoration: none; transition: background-color 0.2s ease; }
.navbar-auth-links .btn-free-trial:hover { background-color: #4d73c0; }
@media (min-width: 1200px) and (max-width: 1399.98px) {
    .navbar-content { column-gap: 1rem; }
    .navbar-main-links { gap: .65rem; }
    .navbar-main-links .nav-link { font-size: .88rem; }
    .navbar-auth-links { gap: .55rem; }
    .navbar-auth-links .btn-login { font-size: .88rem; }
    .navbar-auth-links .btn-free-trial { padding-inline: .75rem; font-size: .82rem; }
}
/*.navbar-auth-links .btn-free-trial { background-color: #1AAB7A; color: white; padding: 0.5rem 1.25rem; border-radius: 6px; font-weight: 600; text-decoration: none; transition: background-color 0.2s ease; }
.navbar-auth-links .btn-free-trial:hover { background-color: #168d65; }*/


/* --- Mega Menu Panel Styling (Desktop) --- */
#toolsMegaMenu {
    position: fixed;
    top: 76px;
    left: 0;
    width: 100%;
    /* Fill the viewport below the header so page content (e.g. the homepage tool
       grid) never shows behind/below the open menu and looks duplicated. */
    bottom: 0;
    overflow-y: auto;
    background-color: #fff;
    border-bottom: 1px solid #dee2e6;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    z-index: 1045; /* Make sure it's above the overlay */
}
/* MODIFIED: Reduced vertical padding to make it more compact */
.mega-menu-panel { padding: 2rem 0; }
/* MODIFIED: Reduced column and row gap to make it more compact */
.mega-menu-content { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 2rem; }
@media (min-width: 1200px) { .mega-menu-content { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Category titles are bold */
.mega-menu-column .menu-col-title { font-weight: 700; margin-bottom: 1rem; color: #333; }

/* --- Tool Card Styling --- */
/* MODIFIED: Reduced gap between tool items */
.tool-grid { display: flex; flex-direction: column; gap: 0.4rem; }
.tool-card { display: flex; align-items: center; gap: 0.85rem; padding: 0.5rem 0.8rem; border: none; border-radius: 6px; /* MODIFIED: Set font-weight to normal (not bold) */ font-weight: 400; color: #333; text-decoration: none; transition: none; background-color: transparent; }
.tool-card:hover { background-color: #f8faff; transform: none; box-shadow: none; }
.tool-card.active { background-color: #e7f0ff; font-weight: 500; /* Medium weight for active */ color: #375891; }
.tool-card .tool-icon { font-size: 1.25rem; width: 25px; text-align: center; }
.tool-card-badges { display: inline-flex; align-items: center; gap: 0.4rem; flex: 0 0 auto; }
.tool-new-badge {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 0.1rem 0.45rem;
    border-radius:4px;
    background: #e8f8ef;
    color: #147a46;
    border: 1px solid #b9e8cd;
    font-size: 0.67rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.mega-menu-hubs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}
.mega-menu-hubs-label { color: #495057; font-size: 0.84rem; font-weight: 700; margin-right: 0.25rem; }
.mega-menu-hub-link {
    color: #375891;
    background: #f3f6fc;
    border: 1px solid #dce4f2;
    border-radius:4px;
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
}
.mega-menu-hub-link:hover, .mega-menu-hub-link.active { color: #fff; background: #4d73c0; border-color: #4d73c0; }

/* --- Page Overlay Styling --- */
#pageOverlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(33, 37, 41, 0.5); z-index: 1040; }

/* --- NEW: Styling for the "Close Menu" Footer --- */
.mega-menu-footer { text-align: center; padding-top: 1rem; margin-top: 0.5rem; }
.close-menu-link { color: #6c757d; text-decoration: none; font-size: 0.9rem; padding: 0.25rem 0.5rem; transition: color 0.2s ease; }
.close-menu-link:hover { color: #4d73c0; text-decoration: underline; }

h2 {
    font-size: 1.8rem;
}

/* ========================================= */
/* --- MOBILE RESPONSIVE STYLES --- */
/* ========================================= */

@media (max-width: 1199.98px) { /* Use the complete compact menu before desktop links can collide. */
	
    /* NEW: Set the specific height for the header on mobile */
    .site-header {
        height: 60px; /* Your desired mobile header height */
    }
    /* 2. Adjust body padding to match new mobile header height */
    body {
        padding-top: 60px; /* This must match the .site-header height on mobile */
    }
	
    /* --- Logo Size on Mobile --- */
    .navbar-logo svg, .footer-logo svg {
        max-width: 150px; /* Smaller max width for mobile */
        max-height: 40px; /* Smaller max height for mobile */
        /* height: auto; is already set in the general rule, ensuring aspect ratio */
    }

    /* --- Font Sizes on Mobile --- */
    /* Adjust these values based on your design preference for mobile content */
    h1 {
        font-size: 2rem;
    }
    .gradient-title {
        font-size: 1.5rem !important;
    }
	.text-muted {
        font-size: 0.9rem !important;
    }
	.text-center {
        margin-bottom: 0.6rem !important;
    }
    h2 {
        font-size: 1.5rem;
    }
    h3 {
        font-size: 1.3rem;
    }
    /* You can add more heading tags (h4, h5, h6) or paragraph text if needed */

    /* --- Hide Desktop Navigation Elements --- */
    .navbar-main-links {
        display: none !important; /* Hide quick links and tools dropdown on mobile */
    }
    .navbar-auth-links {
        display: none !important; /* Hide desktop login/trial on mobile */
    }

    /* --- Show Mobile Toggler --- */
    /* The d-xl-none class on navbar-toggler handles compact-mode visibility. */
    .site-header .navbar-toggler {
        /* Ensure it's properly positioned on the right */
        margin-left: auto; /* Pushes it to the right */
        /* Give the hamburger a finger-friendly tap target (>=44px, the
           accessibility/Google minimum). The icon alone is only ~16px tall. */
        display: flex !important;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
        padding: 0.5rem;
        /* Pull right by the padding so the icon stays flush to the edge */
        margin-right: -0.5rem;
    }

	#mobileMenu {
	        position: fixed;
	        top: 60px; /* This should match the new mobile header height */
	        left: 0;
	        width: 100%;
	        height: calc(100vh - 60px); /* This should also match the new mobile header height */
	        background-color: #fff;
	        z-index: 1045;
	        overflow-y: auto; /* Enable scrolling for content overflow */
	        padding-bottom: 2rem; /* Add some padding at the bottom for scrolling */
	        box-shadow: 0 4px 8px rgba(0,0,0,0.05);
	        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
	    }

    .mobile-menu-panel .container {
        padding: 1.5rem 1rem; /* Adjust padding for mobile menu content */
    }

    .mobile-auth-links .btn {
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }

    .mobile-tools-content .mobile-menu-column .menu-col-title {
        font-size: 0.9rem;
        color: #6c757d; /* Lighter color for category titles */
        margin-bottom: 0.5rem;
    }

    .mobile-tools-content .list-group-item {
        padding: 0.75rem 1rem;
        font-size: 1rem;
        color: #333;
    }

    .mobile-tools-content .list-group-item:hover {
        background-color: #f8faff;
        color: #4d73c0;
    }

    .mobile-tools-content .list-group-item.active {
        background-color: #e7f0ff;
        font-weight: 500;
        color: #375891;
    }

    .mobile-tools-content .list-group-item i {
        font-size: 1rem;
    }

    /* Adjust padding for main content when header is fixed */
    main {
        padding-top: 0 !important; /* Main content padding handled by body padding-top */
    }
}








/* 1. The main container for the button and tooltip */
.tooltip-container {
  position: relative; /* This is crucial for positioning the tooltip */
  display: inline-block;
  /* NOTE: no permanent z-index here. A constant z-index:1200 put every tool-card
     (including the ones in the footer sitemap) into its own stacking layer ABOVE
     the open Tools mega-menu overlay (#toolsMegaMenu is z-1045). That made the
     footer's tools bleed up through the open menu and look duplicated. We only
     need the card lifted while its tooltip is actually showing, so we elevate it
     on :hover instead. The tooltip bubble (::before/::after) keeps its own
     z-index:1200, so tooltips still render above neighbouring cards. */
}
/* Lift only the hovered card so its tooltip sits above its neighbours. */
.tooltip-container:hover {
  z-index: 1200;
}

/* 2. The tooltip box (created with ::after) */
.tooltip-container::after {
  content: attr(data-tooltip); /* Pulls text from the data-tooltip attribute */
  position: absolute;
  bottom: calc(100% + 10px); /* Position it 10px above the container */
  left: 50%;
  transform: translateX(-50%); /* This combination perfectly centers the tooltip */
  z-index: 1200;

  /* Styling */
  background-color: #3e474f; /* Dark gray background */
  color: #fff; /* White text */
  padding: 10px 15px;
  border-radius: 5px;
  width: 200px; /* Set a specific width */
  text-align: center;
  font-size: 14px;
  line-height: 1.4;

  /* Hide it by default */
  opacity: 0;
  pointer-events: none; /* The tooltip itself shouldn't be interactive */
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* 3. The tooltip arrow (created with ::before) */
.tooltip-container::before {
  content: ''; /* This pseudo-element is for shape only */
  position: absolute;
  bottom: 100%; /* Position it right at the top of the button */
  left: 50%;
  transform: translateX(-50%);

  /* Creating the triangle */
  border: 5px solid transparent;
  border-top-color: #3e474f; /* This side creates the visible triangle */

  /* Hide it by default */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 1200;
}


/* 4. Show the tooltip and arrow on hover */
.tooltip-container:hover::before,
.tooltip-container:hover::after {
  opacity: 1;
  /* Optional: Add a subtle upward movement on appear */
  transform: translateX(-50%) translateY(-5px); 
  z-index: 1200;
}

/* Optional: Styling for the button to match the image */
.my-button {
  background-color: #fd9e32; /* Orange color */
  border: none;
  padding: 15px 25px;
  border-radius: 5px;
  color: white;
  font-size: 16px;
  cursor: pointer;
  font-family: sans-serif;
}












/* --- General Article and Content Styling (Moved from tool.html) --- */
/* These styles define the appearance of headings and lists within article content,
   which can be found on various content pages, not just tool-specific ones. */
.article-content h1, .article-content h2, .article-content h3, .article-content h4, .article-content h5, .article-content h6 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: #343a40;
}
.article-content h1 { font-size: 2.5rem; }
.article-content h2 { font-size: 2rem; }
.article-content h3 { font-size: 1.75rem; }
.article-content ul, .article-content ol {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}
.article-content li {
    margin-bottom: 0.5rem;
}

/* --- FAQ Section Styling (Moved from tool.html) --- */
/* Styles for Frequently Asked Questions sections, which can appear on many pages. */
.faq-section {
    margin-top: 0rem;
    margin-bottom: 0rem;
    padding: 0rem 0;
}
.faq-toc {
    list-style: none;
    padding: 0;
    margin-bottom: 2rem;
    text-align: left;
}
.faq-toc li {
    margin-bottom: 0.5rem;
}
.faq-toc li a {
    text-decoration: none;
    color: #007bff;
    font-weight: 500;
}
.faq-toc li a:hover {
    text-decoration: underline;
    color: #0056b3;
}
.faq-item {
    margin-bottom: 2rem;
    padding: 0;
}
.faq-question {
    font-size: 1.25rem;
    font-weight: bold;
    color: #343a40;
    margin-bottom: 0.75rem;
    text-align: left;
}
.faq-answer {
    color: #6c757d;
    line-height: 1.6;
    text-align: left;
}

/* --- Mobile Responsive Styles (General elements, moved from tool.html) --- */
/* These include general font size adjustments for headings and paragraphs on mobile,
   and mobile menu specific styles that belong with the header. */
@media (max-width: 991.98px) { /* Applies to screens smaller than large (lg) breakpoint */
    /* General Font Sizes on Mobile */
    h1 {
        font-size: 2rem;
    }
    h2 {
        font-size: 1.5rem;
    }
    h3 {
        font-size: 1.3rem;
    }
    p {
        /* Keep mobile body copy at a readable 16px (was 0.9rem !important, which
           squashed blog article paragraphs below the accessible minimum). */
        font-size: 1rem;
    }

    /* Mobile Menu Specifics */
    .mobile-menu-panel .container {
        padding: 1.5rem 1rem; /* Adjust padding for mobile menu content */
    }
    .mobile-auth-links .btn {
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }
    .mobile-tools-content .mobile-menu-column .menu-col-title {
        font-size: 0.9rem;
        color: #6c757d; /* Lighter color for category titles */
        margin-bottom: 0.5rem;
    }
    .mobile-tools-content .list-group-item {
        padding: 0.75rem 1rem;
        font-size: 1rem;
        color: #333;
    }
    .mobile-tools-content .list-group-item:hover {
        background-color: #f8faff;
        color: #4d73c0;
    }
    .mobile-tools-content .list-group-item.active {
        background-color: #e7f0ff;
        font-weight: 500;
        color: #375891;
    }
    .mobile-tools-content .list-group-item i {
        font-size: 1rem;
    }

    /* Adjust padding for main content when header is fixed */
    main {
        padding-top: 0 !important; /* Main content padding handled by body padding-top */
    }
}
