/* ==============================================
   1. Root Variables & Global Reset
   ============================================== */
:root {
    --color-bg-dark: #304d6d;
    --color-bg-medium: #3b5978;
    --color-bg-light: #4975a4;
    --color-bg-results: #222d3d;
    --color-nav: #a7cced;
    --color-nav-hover: #545e75;
    --color-nav-sub: #63adf2;
    --color-text-primary: #a6caec;
    --color-text-nav: #304d6d;
    --color-text-light: #ffffff;
    --color-accent-green: #4CAF50;
    --color-border: #cccccc;

    --font-primary: Roboto, Arial, sans-serif;
    --font-code: monospace;
}

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

html {
    font-size: 16px; /* Sets the base for 1rem */
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-bg-dark);
    color: var(--color-text-primary);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ==============================================
   2. Header & Logo
   ============================================== */
header {
    margin: 0.625rem; /* 10px */
    text-align: center;
}

.header-content {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.625rem; /* 10px */
}

.logo {
    height: auto;
    max-width: 95%; /* Limit logo size on mobile */
    max-height: 100px; /* Example max height */
}

.tagline {
    color: var(--color-nav);
    font-weight: 300;
    margin-top: 0.5rem; /* Add some space below logo */
}

/* ==============================================
   3. Navbar (Modernized with Hamburger)
   ============================================== */
.navbar {
    background-color: var(--color-nav);
    padding: 0.625rem 1.25rem; /* 10px 20px */
    display: flex;
    justify-content: center; /* Center links on desktop */
    align-items: center;
    position: relative;
    z-index: 100;
    flex-wrap: wrap; /* Allow wrapping if too many items */
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 0.625rem; /* 10px */
    flex-wrap: wrap; /* Allow links to wrap on slightly smaller screens */
    justify-content: center; /* Center items when wrapping */
}

.navbar a {
    font-size: 1rem; /* 16px */
    color: var(--color-text-nav);
    text-decoration: none;
    padding: 0.625rem 0.9375rem; /* 10px 15px */
    border-radius: 5px;
    transition: background-color 0.3s ease;
    white-space: nowrap; /* Prevent text wrapping within links */
}

.navbar a:hover,
.navbar a.active {
    background-color: var(--color-nav-hover);
    color: var(--color-text-light);
}

/* Subnav */
.subnav {
    position: relative;
    display: flex;
}

.subnavbtn {
    font-size: 1rem;
    color: var(--color-text-nav);
    padding: 0.625rem 0.9375rem;
    background-color: inherit;
    border: none;
    outline: none;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    /* Ensure button takes space like a regular link */
    display: inline-block;
    line-height: normal; /* Adjust if needed */
    vertical-align: middle; /* Align with other links */
}


.subnav:hover .subnavbtn {
    background-color: var(--color-nav-sub);
    color: black;
}

.subnav-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--color-nav-sub);
    min-width: 100%; /* Ensures it's at least as wide as the button */
    z-index: 100;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    padding: 0.5rem 0; /* Add some padding */
}

.subnav:hover .subnav-content {
    display: block;
}

.subnav-content a {
    color: var(--color-text-light);
    padding: 0.625rem 0.9375rem;
    text-decoration: none;
    display: block;
    white-space: nowrap;
}

.subnav-content a:hover {
    background-color: var(--color-nav-hover);
}

/* Hamburger Toggle Button (Hidden on Desktop) */
.navbar-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    margin-right: 1rem; /* Space between toggle and links on mobile */
}

.hamburger {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--color-text-nav);
    position: relative;
    transition: background-color 0.3s ease-in-out;
}

.hamburger::before,
.hamburger::after {
    content: "";
    position: absolute;
    width: 25px;
    height: 3px;
    background-color: var(--color-text-nav);
    left: 0;
    transition: transform 0.3s ease-in-out;
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    bottom: -8px;
}

/* ==============================================
   4. Main 3-Column Fluid Layout
   ============================================== */
main {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.25rem;
    max-width: 1600px;
    width: 100%;
    padding: 0.625rem;
    margin-left: auto;
    margin-right: auto;
    margin-top: 0.625rem;
    margin-bottom: 1.25rem;
    flex-grow: 1; /* Make main content area grow */
}

/* Block 1 & 3: Ad Blocks (Fluid & Responsive) */
.ad-column-left,
.ad-column-right {
    flex: 1 1 160px;
    min-width: 160px;
}

/* Block 2: Center Content (Fluid & Responsive) */
.center-content {
    flex: 2 1 600px;
    max-width: 700px;
    width: 100%;
}

.ad-column-left ins,
.ad-column-right ins {
    display: block;
    min-height: 250px; /* Example minimum height for ad slots */
    background-color: #f0f0f0; /* Placeholder color */
}

/* Optional: Style for inline ad pods */
.ad-pod {
    margin: 1.5rem 0;
    text-align: center;
}
.ad-pod ins {
     display: inline-block; /* Center block elements */
     min-height: 90px; /* Example min height */
     background-color: #f0f0f0; /* Placeholder color */
}


/* ==============================================
   5. Content Sections (Intro, Services, Tools)
   ============================================== */
.intro {
    background-color: var(--color-bg-medium);
    padding: 1.25rem; /* 20px */
    border-radius: 5px;
    margin-bottom: 1.25rem;
}

.intro h3 {
    color: var(--color-text-primary);
    margin-bottom: 0.625rem;
}

.intro p {
    color: var(--color-text-primary);
    margin-bottom: 0.9375rem; /* 15px */
}

.qr-code {
    max-width: 150px;
    height: auto;
    margin: 0.625rem auto;
    display: block;
}

/* Services Section */
.services {
    padding: 1.25rem 0;
}

.services h2 {
    color: var(--color-text-primary);
    margin-bottom: 1.25rem;
    text-align: center; /* Center section titles */
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
}

/* Clickable Grid Items */
.service-item,
.tool-icon a { /* Applied similar styling for consistency */
    display: block; /* Make the anchor fill the grid cell */
    background-color: var(--color-bg-light);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 0.9375rem; /* 15px */
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    color: var(--color-text-primary);
    text-align: center; /* Center content within grid items */
}

.service-item:hover,
.tool-icon a:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.service-item img,
.tool-icon img { /* Common image styling */
    max-width: 60%;
    height: auto;
    border-radius: 5px;
    margin-bottom: 0.5rem; /* Space below image */
}

/* Placeholder specific style */
.icon-placeholder {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--color-text-nav);
    margin-bottom: 0.5rem;
    line-height: 1;
}

.service-item h3,
.tool-icon p { /* Common text styling */
    color: var(--color-text-primary);
    margin: 0.625rem 0;
}

.service-item p {
    color: var(--color-text-primary);
}

/* Tool Section */
.tool-section {
    margin: 1.25rem 0;
}

/* Common style for all tool containers */
#calculator, #dns-lookup, #scanner, #ip-details, #port-scanner, #whois-lookup, #traceroute, #ping-tool, #ssl-checker, #headers-inspector, #ping-traceroute {
    width: 100%;
    padding: 1.25rem;
    border: 1px solid var(--color-border);
    border-radius: 5px;
    background-color: var(--color-bg-medium);
    margin-bottom: 1.25rem;
}

.tool-section h2 {
    color: var(--color-text-primary);
    text-align: center;
    margin-bottom: 0.9375rem;
}

.tool-section label {
    display: block;
    margin: 0.625rem 0 0.3125rem; /* 10px 0 5px */
    color: var(--color-text-primary);
}

.tool-section input[type="text"] {
    width: 100%;
    padding: 0.625rem;
    margin-bottom: 0.625rem;
    border: 1px solid var(--color-border);
    border-radius: 5px;
    background-color: var(--color-text-light); /* Light background for input */
    color: var(--color-text-nav); /* Dark text for input */
}

.tool-section button {
    background-color: var(--color-accent-green);
    color: var(--color-text-light);
    padding: 0.625rem 1.25rem;
    margin-top: 0.625rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    font-size: 1.1rem;
    transition: background-color 0.3s;
}
/* Style multiple buttons in one tool section */
#ping-traceroute button {
    width: auto; /* Allow buttons side-by-side */
    padding: 0.625rem 1rem;
    margin-right: 0.5rem; /* Space between buttons */
    margin-bottom: 0.5rem; /* Space below buttons if they wrap */
}


.tool-section button:hover {
    background-color: #45a049;
}

/* Common style for all results blocks */
.results, /* Use class for pingtool.html */
#results, #scan-results, #ip-results, #port-results, #whois-results, #trace-results, #ping-results, #ssl-results, #header-results {
    margin-top: 1.25rem;
    font-family: var(--font-code);
    white-space: pre-wrap;
    word-break: break-all;
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
    padding: 0.9375rem;
    min-height: 100px;
    background-color: var(--color-bg-results);
    font-size: 0.875rem; /* 14px */
    line-height: 1.6;
    width: 100%;
    border-radius: 5px;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--color-text-primary);
    border-top: 3px solid var(--color-accent-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==============================================
   6. Footer
   ============================================== */
footer {
    text-align: center;
    padding: 1.25rem 0;
    background-color: var(--color-bg-medium);
    color: var(--color-text-primary);
    width: 100%;
    margin-top: auto; /* Pushes footer to bottom */
}

/* ==============================================
   7. Page-Specific Styles (About, Contact, etc.)
   ============================================== */

/* Team Grid (about.html) */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
    padding: 1.25rem 0; /* Adjusted padding */
}

.team-member {
    background-color: var(--color-bg-light);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 0.9375rem;
    text-align: center;
}

.team-member img {
    max-width: 60%;
    height: auto;
    border-radius: 5px;
    margin-bottom: 0.5rem;
}

.team-member h3 {
    color: var(--color-text-primary);
    margin: 0.625rem 0;
}

.team-member p {
    color: var(--color-text-primary);
}

/* About Section Headings */
.about-section h2, .info-section h2 { /* Shared style */
    color: var(--color-text-primary);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    text-align: center;
}
/* General Info Section styling */
.info-section {
    background-color: var(--color-bg-medium);
    padding: 1.25rem;
    border-radius: 5px;
    margin-top: 1.25rem;
}
.info-section h2 {
    text-align: left; /* Override center align for these */
    margin-top: 0;
}
.info-section p, .info-section li {
     color: var(--color-text-light); /* Lighter text for contrast */
     margin-bottom: 0.75rem;
}
.info-section ul, .info-section ol {
    margin-left: 1.5rem; /* Indent lists */
    margin-bottom: 1rem;
}
.info-section strong {
    color: var(--color-nav); /* Highlight important terms */
}


/* Contact/Careers Section (contact.html, careers.html) */
.contact-section,
.careers-section {
    text-align: center;
    padding: 1.25rem;
    background-color: var(--color-bg-light);
    border-radius: 10px;
    margin-top: 1.25rem; /* Add space if needed */
}

.contact-section h2,
.careers-section h2 {
    color: var(--color-text-light);
    margin-bottom: 0.9375rem;
}

.contact-section p,
.careers-section p {
    color: var(--color-text-light);
    margin-bottom: 1rem;
}

.contact-section a,
.careers-section a {
    color: var(--color-text-primary);
    text-decoration: underline; /* Make links clearer */
}

.contact-section a:hover,
.careers-section a:hover {
    color: var(--color-nav-sub);
}

.benefits-list {
    list-style: disc; /* Use standard bullets */
    padding-left: 2rem; /* Indent list */
    text-align: left;
    display: inline-block;
    color: var(--color-text-light);
    margin-top: 1rem;
}

.benefits-list li {
    margin: 0.625rem 0;
}

/* Tech Tips Section (techtips.html) */
.techtips-section h2 {
    color: var(--color-text-primary);
    text-align: center;
    margin-bottom: 1.25rem;
}

.techtips-section .tip {
    background-color: var(--color-bg-light);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 0.9375rem;
    margin-bottom: 1.25rem;
    text-align: left;
}

.techtips-section h3 {
    color: var(--color-text-light);
    margin-bottom: 0.625rem;
}

.techtips-section p {
    color: var(--color-text-light);
    margin-bottom: 0.5rem; /* Space between paragraphs in a tip */
}
.techtips-section p:last-child {
    margin-bottom: 0;
}

/* Resources Page specific */
.resources h2, .resources h3 {
    color: var(--color-text-primary);
    text-align: center;
    margin-bottom: 1rem;
    margin-top: 1.5rem;
}
.resources hr {
    border: 0;
    height: 1px;
    background-color: var(--color-bg-light);
    margin: 2rem 0;
}
.resources ul, .resources li { /* Style lists on resources page */
     color: var(--color-text-light);
     margin-left: 1.5rem;
     margin-bottom: 0.5rem;
}
.guides-list, .tools-list {
    list-style: none;
    padding: 0;
    text-align: center;
    margin-left: 0; /* Reset indent for these lists */
}
.guides-list li, .tools-list li {
    margin-bottom: 0.5rem;
    margin-left: 0;
}
.guides-list a, .tools-list a {
    color: var(--color-text-primary);
}
.guides-list a:hover, .tools-list a:hover {
    color: var(--color-nav-sub);
}
.blog-post { /* Style blog post previews */
     background-color: var(--color-bg-light);
     border: 1px solid var(--color-border);
     border-radius: 10px;
     padding: 1rem;
     text-align: center;
}
.blog-post img {
     max-width: 40%; /* Adjust as needed */
     height: auto;
     margin-bottom: 0.5rem;
}
.blog-post h4 {
     color: var(--color-text-light);
     margin-bottom: 0.5rem;
}

/* Contact Prompt (e.g., on services page) */
.contact-prompt h3 {
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
}
.contact-prompt p {
    color: var(--color-text-light);
}
.contact-prompt a {
    color: var(--color-nav-sub); /* Standout link color */
    text-decoration: underline;
    font-weight: bold;
}
.contact-prompt a:hover {
    color: var(--color-text-light);
}


/* ==============================================
   8. Responsive Adjustments (Mobile)
   ============================================== */
@media (max-width: 768px) {
    .navbar {
        justify-content: space-between; /* Puts toggle on end */
    }

    .navbar-toggle {
        display: block; /* Show the hamburger button */
    }

    .navbar-links {
        display: none; /* Hide the links by default */
        position: absolute;
        top: 100%; /* Position below the navbar */
        left: 0;
        right: 0;
        background-color: var(--color-nav);
        width: 100%;
        flex-direction: column;
        padding: 0.625rem;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        align-items: flex-start; /* Align items left */
        max-height: calc(100vh - 70px); /* Limit height, adjust 70px based on header/nav height */
        overflow-y: auto; /* Allow scrolling if menu is long */
    }

    .navbar-links.active {
        display: flex; /* Show links when button is clicked */
    }

    .navbar a,
    .subnav {
        display: block;
        width: 100%;
        margin: 0.3125rem 0; /* 5px 0 */
        text-align: left;
    }

    /* Ensure subnav button text doesn't wrap oddly */
     .subnavbtn {
         width: 100%;
         text-align: left;
         padding: 0.625rem 0.9375rem; /* Consistent padding */
     }

    .subnav-content {
        position: relative; /* Stack subnav inside main nav */
        top: auto;
        left: auto;
        width: 100%;
        box-shadow: none;
        border-radius: 0;
        background-color: transparent; /* Match parent background */
        padding: 0;
        margin-top: 0.25rem;
        /* Ensure subnav content is always visible when parent is hovered/active on mobile */
        display: none; /* Hide by default */
    }
    .subnav:hover .subnav-content,
    .subnav .subnavbtn.active + .subnav-content { /* Show if button is active */
         display: block;
    }
     /* Alternative: Use JS to toggle subnav on mobile click */


    .subnav-content a {
        padding-left: 2rem; /* Indent sub-links */
        color: var(--color-text-nav); /* Match parent text color */
        padding-top: 0.4rem;
        padding-bottom: 0.4rem;
        background-color: rgba(255, 255, 255, 0.1); /* Slightly different background */
        border-radius: 3px;
        margin: 2px 0;
    }
     .subnav-content a:hover {
         background-color: rgba(0,0,0,0.1); /* Slight hover effect */
     }
      .subnav-content a.active { /* Style active subnav link */
          background-color: var(--color-nav-hover);
          color: var(--color-text-light);
      }

    /* Animate the hamburger icon */
    .navbar-toggle[aria-expanded="true"] .hamburger {
        background-color: transparent; /* Middle bar fades */
    }
    .navbar-toggle[aria-expanded="true"] .hamburger::before {
        transform: rotate(45deg) translate(5px, 7px);
    }
    .navbar-toggle[aria-expanded="true"] .hamburger::after {
        transform: rotate(-45deg) translate(5px, -7px);
    }

    /* Ad column adjustments */
    .ad-column-left,
    .ad-column-right {
        order: 99; /* Push ads to the bottom when stacked */
        flex-basis: 100%; /* Make them full width when stacked */
        text-align: center; /* Center ad content */
        margin-top: 1rem; /* Add space when stacked */
    }
    .center-content {
        order: 1; /* Ensure content comes first */
        flex-basis: 100%; /* Make it full width */
    }

     /* Reduce logo size slightly more on mobile */
    .logo {
        max-height: 80px;
    }
}

/* Specific style for Placeholder icons (if used) */
.icon-placeholder {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--color-text-nav);
    margin-bottom: 0.5rem;
    line-height: 1;
}