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

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


.site-header { position: fixed; top: 0; left: 0; width: 100%; height: 88px; 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: flex; justify-content: space-between; align-items: center; width: 100%; position: relative; }

/* --- 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 */
}

/* 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: absolute; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 1.5rem; }
.navbar-main-links .nav-link { color: #333 !important; font-weight: 500; cursor: pointer; }
.navbar-main-links .nav-link:hover { color: #4d73c0 !important; }

/* MODIFIED: Styling for the Tools button and its arrow */
.tools-dropdown-toggle { display: flex; align-items: center; gap: 0.5rem; }
.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; gap: 1.5rem; }
.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.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: #4d73c0; }
/*.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: 88px;
    left: 0;
    width: 100%;
    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, 1fr); gap: 1.5rem 2rem; }
@media (min-width: 1200px) { .mega-menu-content { grid-template-columns: repeat(6, 1fr); } }

/* Category titles are bold */
.mega-menu-column h6 { 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; }

/* --- 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: 1.5rem; border-top: 1px solid #e9ecef; margin-top: 1.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: 991.98px) { /* Applies to screens smaller than large (lg) breakpoint */
	
    /* 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-lg-none class on navbar-toggler already handles showing it on mobile */
    .site-header .navbar-toggler {
        /* Ensure it's properly positioned on the right */
        margin-left: auto; /* Pushes it to the right */
    }

	#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 h6 {
        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;
  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 {
        font-size: 0.9rem !important;
    }

    /* 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 h6 {
        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 */
    }
}