/* --- CSS Variables for Theming (White Background) --- */
:root {
    --bg-main: #ffffff;
    --bg-offset: #f9fafb;
    --bg-card: #ffffff;
    --border-color: #e5e7eb;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --accent-blue: #3b82f6;
    --accent-blue-hover: #2563eb;
    --accent-green: #16a34a;
    --accent-green-hover: #15803d;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --shadow-small: 0 1px 2px 0 rgba(0,0,0,0.05);
    --shadow-medium: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -2px rgba(0,0,0,0.05);
    --border-radius: 0.75rem;
    --header-height: 70px;
}

/* --- Base Styles --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
}
body {
    /* --- Your existing body styles --- */
    font-family: var(--font-family);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    padding-top: var(--header-height);

    zoom: 0.70;
}

/* --- Site Header --- */
.site-header {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    height: var(--header-height);
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
}
.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo img {
    height: 40px; /* Default desktop logo height */
    width: auto;
    display: block;
}

/* --- Main Navigation (Desktop) --- */
.main-nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.main-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem;
    transition: color 0.2s;
}
.main-nav a:hover {
    color: var(--accent-blue);
}

/* --- Main Content & Shared Styles --- */
.main-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}
.main-header {
    padding: 2rem 1rem;
    margin-bottom: 3rem;
    text-align: center;
}
.hero-content {
    max-width: 800px;
    margin: 0 auto;
}
.hero-content .title {
    font-size: clamp(3rem, 4vw, 5rem);
    font-weight: 700;
    line-height: 1.2;
}
.hero-content .title .highlight {
    color: var(--accent-blue);
}
.hero-content .subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 1.5rem auto 2.5rem;
}
.card {
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 2rem;
    box-shadow: var(--shadow-medium);
    position: relative; 
}
.input-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
#text-input {
    width: 100%;
    min-height: 180px;
    padding: 1rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}
#text-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* --- Drag & Drop --- */
.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 2.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s, background-color 0.3s;
}
.drop-zone.dragover {
    background-color: #eef2ff;
    border-color: var(--accent-blue);
}
.drop-zone-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: var(--text-secondary);
}
.upload-icon {
    width: 2.5rem;
    height: 2.5rem;
    stroke-width: 1.5;
    color: var(--text-secondary);
}
.file-button-link {
    font-weight: 600;
    color: var(--accent-blue);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* --- Buttons --- */
.button-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.button-primary, .button-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    gap: 0.5rem;
    padding: 0.8rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    flex-grow: 1;
}
.button-primary {
    background-color: var(--accent-blue);
    color: #fff;
    border-color: var(--accent-blue);
}
.button-primary:hover {
    background-color: var(--accent-blue-hover);
    border-color: var(--accent-blue-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}
.button-secondary {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-color);
}
.button-secondary:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
}

/* --- Results --- */
.results-section {
    padding: 0;
    border: none;
    background: none;
    box-shadow: none;
    margin-top: 4rem;
}
.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.stat-item {
    background-color: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    text-align: center;
}
.stat-item .count {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-green);
}
.stat-item .label {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}
.export-actions {
    text-align: center;
    margin-bottom: 3rem;
}


.domain-card-actions {
    display: flex;
    gap: 0.5rem;
}

.copy-btn-small.copied,
#copy-all-btn.copied {
   
    border-color: var(--accent-blue);
    color: #fff;
}
.export-btn {
    background-color: var(--accent-green);
    color: #fff;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}
.export-btn:hover {
    background-color: var(--accent-green-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.2);
}
.results-header {
    text-align: center;
    margin-bottom: 2rem;
}
.results-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}
.results-header p {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0.5rem auto 0;
}

.grouped-results {
    display: grid;
    /* This change creates 3 equal columns and allows them to wrap on smaller screens */
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    max-width: 95%; /* Use a slightly wider container */
    margin: 0 auto;
}



.domain-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem 1.25rem; /* Adjust padding for a better fit */
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease-in-out;
    /* Add a minimum height to keep all cards uniform */
    min-height: 80px; 
}

.domain-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-blue);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.domain-info .domain-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    display: block;
    /* Prevents very long domain names from breaking the layout */
    word-break: break-all;
}

.domain-info .domain-count {
    /* Font size is reduced */
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.export-btn-small,
.copy-btn-small {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #f3f4f6;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    /* Padding and font size are reduced to make buttons smaller */
    padding: 0.4rem 0.8rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s;
}

.export-btn-small:hover,
.copy-btn-small:hover {
    background-color: #e5e7eb;
    color: var(--text-primary);
}

/* --- Info & FAQ Sections --- */
.info-section {
    text-align: center;
    padding: 4rem 1.5rem;
    margin-top: 4rem;
}
.info-section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--text-primary);
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    text-align: left;
}
.feature-card {
    background-color: var(--bg-card);
    padding: 2rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease-in-out;
}


.feature-card:hover {
    transform: scale(1.05); /* Makes the card 5% larger */
    box-shadow: var(--shadow-medium); /* Adds a subtle shadow */
    border-color: var(--accent-blue); /* Highlights the border */
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}
.feature-card p {
    color: var(--text-secondary);
}


.feature-card-link {
    text-decoration: none; 
    color: inherit;
    display: block;
}


/* --- Mobile Menu Button --- */
.mobile-menu-btn {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1010; /* Must be on top of the menu */
    position: relative;
}
.hamburger-line {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    margin: 5px 0;
    transition: all 0.3s ease-in-out;
}

/* --- Language Switcher --- */
.language-switcher-container {
    position: relative;
}
#language-switcher {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding: 0.5rem 2rem 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: var(--bg-card);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.language-switcher-container::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    pointer-events: none;
}
#language-switcher:hover {
    border-color: var(--accent-blue);
}
#language-switcher:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* --- Content Page & Footer Link Styles --- */
.content-card {
    max-width: 800px;
    margin: 0 auto 4rem auto; /* Center the card on the page */
    text-align: left;
}

.content-card h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.content-card p, .content-card li {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.content-card ul {
    list-style-position: inside;
    padding-left: 1rem;
}

.footer-links {
    margin-top: 1rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--accent-blue);
  
}


/* --- ADD THIS CODE --- */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 10;
    border-radius: var(--border-radius);
    backdrop-filter: blur(4px);
    transition: opacity 0.3s;
}

.loading-overlay.visible {
    display: flex;
}

.loading-spinner {
    border: 5px solid rgba(0, 0, 0, 0.1);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border-left-color: var(--accent-blue);
    animation: spin 1s ease-in-out infinite;
}

.loading-overlay p {
    margin-top: 1.5rem;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

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

/* ---------------------------------- */



/* ---------------------------------- */
/* --- Professional Responsive Design --- */
/* ---------------------------------- */

@media (max-width: 900px) {
    /* --- Modern Off-Canvas Menu Setup --- */
    .main-nav {
        position: fixed;
        top: 0;
        right: 0;
        width: 300px; /* Width of the slide-in menu */
        height: 100vh; /* Full screen height */
        background-color: var(--bg-main);
        box-shadow: -5px 0px 15px rgba(0,0,0,0.1);
        transform: translateX(100%); /* Hides menu off-screen to the right */
        transition: transform 0.3s ease-in-out;
        padding-top: var(--header-height);
        z-index: 1005;
    }
    .main-nav.active {
        transform: translateX(0); /* Slides menu into view */
    }
    .main-nav ul {
        flex-direction: column;
        align-items: flex-start; /* Align links to the left */
        gap: 0;
        padding: 1rem 0;
        height: 100%;
    }
    .main-nav li {
        width: 100%;
    }
    .main-nav a {
        display: block;
        padding: 1rem 1.5rem;
        width: 100%;
        font-size: 1.1rem;
    }
    .language-switcher-container {
        padding: 1rem 1.5rem; /* Add padding to position switcher in menu */
    }
    #language-switcher {
        width: 100%; /* Make dropdown full-width within the menu */
    }

    /* --- Hamburger Menu --- */
    .mobile-menu-btn {
        display: block; /* Show the button on mobile */
    }
    /* Animated 'X' for active state */
    .mobile-menu-btn.active .hamburger-line:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .mobile-menu-btn.active .hamburger-line:nth-child(2) {
        opacity: 0;
    }
    .mobile-menu-btn.active .hamburger-line:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* --- Header & Content Spacing --- */
    .header-container {
        padding: 0 1rem;
    }
    .logo img {
        height: 35px; /* Slightly smaller logo on mobile */
    }
    .main-container {
        padding: 1.5rem 1rem;
    }
    .main-header {
        padding: 1.5rem 0;
        margin-bottom: 2rem;
    }
    .info-section {
        padding: 3rem 1rem;
        margin-top: 3rem;
    }
}


/* == For Smaller Mobile Devices (breakpoint: 576px) == */
@media (max-width: 576px) {
    /* --- Typography --- */
    .hero-content .title {
        font-size: clamp(2rem, 10vw, 2.5rem); /* Adjust clamp for mobile */
    }
    .hero-content .subtitle {
        font-size: 1rem;
    }
    .info-section h2, .results-header h2 {
        font-size: 1.75rem;
        margin-bottom: 2rem;
    }

    /* --- Layout & Spacing --- */
    .card {
        padding: 1.5rem;
    }
    .summary-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .button-primary, .button-secondary {
        width: 100%;
        padding: 1rem 1.5rem; /* Larger tap targets for buttons */
        font-size: 1.1rem;
    }
    .drop-zone {
        padding: 2rem 1.5rem;
    }
}




/* --- NEW: Professional FAQ Section Styles --- */

/* This is the main container for the FAQ list */
.faq-container {
    max-width: 800px; /* Sets a max-width for better readability */
    margin: 0 auto;   /* Centers the container */
    text-align: left;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden; /* Ensures the border-radius is applied to children */
}

/* This styles each individual question/answer item */
.faq-item {
    border-bottom: 1px solid var(--border-color);
}
.faq-item:last-child {
    border-bottom: none; /* Removes the border from the last item */
}

/* This styles the question (the part you click on) */
.faq-item summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    list-style: none; /* Removes the default triangle icon */
    transition: background-color 0.2s;
}

.faq-item summary:hover {
    background-color: var(--bg-offset);
}

/* This creates the custom plus/minus icon */
.faq-item summary::after {
    content: '+';
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--accent-blue);
    transition: transform 0.3s ease-in-out;
}

/* This styles the answer part */
.faq-item p {
    padding: 0 1.5rem 1.5rem 1.5rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* --- The "Magic": Animation when you open an item --- */

/* When the <details> element is open, rotate the icon to a minus sign */
.faq-item[open] summary::after {
    content: '−'; /* This is a minus sign, not a hyphen */
    transform: rotate(180deg);
}

/* When the <details> element is open, change the background color of the question */
.faq-item[open] summary {
    background-color: var(--bg-offset);
}











/* --- Results Section Styling --- */
.results-section {
    margin-top: 2rem;
    padding: 2rem 0;
}

.summary-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.stat-item {
    background-color: var(--card-background);
    box-shadow: var(--card-box-shadow);
    padding: 1.5rem 2rem;
    border-radius: 8px;
    text-align: center;
}

.stat-item .count {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-item .label {
    font-size: 1rem;
    color: var(--text-color);
    margin-top: 0.5rem;
}

.export-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* --- Styled List of Phone Numbers --- */
.results-card {
    background-color: var(--card-background);
    border-radius: 8px;
    box-shadow: var(--card-box-shadow);
    padding: 1.5rem;
    margin: 0 auto;
    max-width: 700px;
}

.phone-numbers-list {
    display: flex;
    flex-wrap: wrap; /* Allows items to wrap to the next line */
    gap: 0.75rem; /* Space between each number item */
    padding: 0;
    margin: 0;
}

.phone-number-item {
    background-color: var(--input-background); /* Or a light gray */
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-family: monospace;
    color: var(--primary-color);
    cursor: default; /* Change cursor to default, as it's not clickable */
}

.no-results-message {
    text-align: center;
    width: 100%;
    color: var(--text-color);
    font-style: italic;
}









/* --- Footer --- */
.main-footer-bottom {

    border-top: 1px solid var(--border-color);
    padding: 3rem 1.5rem;
}

.footer-grid {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto;
    gap: 2rem;
}

.footer-column {
    /* We remove flex: 1 to prevent columns from taking up equal, misaligned space */
    width: auto;
    min-width: 180px; /* Adjust min-width to better fit the content */
}

/* This targets the center column specifically for better alignment */
.footer-column.text-center {
    flex-grow: 1; /* Allow the middle column to grow and push the others apart */
    text-align: center;
    min-width: 250px; /* Give the center column a bit more space by default */
}

.footer-column h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.footer-column p,
.footer-column a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-column a:hover {
    color: var(--accent-blue);
}

.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column li {
    margin-bottom: 0.5rem;
}

/* Responsive adjustments for the footer */
@media (max-width: 768px) {
    .footer-grid {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .footer-column {
        min-width: auto;
        width: 100%;
        text-align: center;
    }
    .footer-column ul {
        margin-top: 0.5rem;
    }
}