/* Basic Resets & Global Styles */
:root {
    --primary-color: #007BFF;
    --secondary-color: #6C757D;
    --accent-color: #28A745; /* For highlights or success */
    --text-color: #333;
    --light-bg: #f8f9fa;
    --dark-bg: #343a40;
    --border-color: #dee2e6;
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Open Sans', sans-serif;
}

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

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
    scroll-behavior: smooth;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3 {
    font-family: var(--font-heading);
    color: var(--primary-color);
    margin-bottom: 20px;
}

h1 { font-size: 3em; text-align: center; }
h2 { font-size: 2.5em; text-align: center; }
h3 { font-size: 1.8em; }

p {
    margin-bottom: 15px;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.highlight-text {
    color: var(--accent-color);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 5px;
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    transition: background-color 0.3s ease, transform 0.2s ease;
    text-align: center;
}

.primary-btn {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
}

.primary-btn:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    text-decoration: none;
}

.large-btn {
    font-size: 1.2em;
    padding: 15px 30px;
    margin-top: 30px;
}

.btn.primary-btn.large-btn.cta { /* Target all classes on the button */
    border: 2px solid white; /* Specify width and style for visibility */
}

/* Sections */
.section {
    padding: 80px 0;
    border-bottom: 1px solid var(--border-color);
}

.section:last-of-type {
    border-bottom: none;
}

/* Hero Section */
.hero-section {
    background-color: var(--light-bg);
    padding: 100px 0;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.hero-section .domain-name {
    font-size: 4em;
    color: var(--dark-bg);
    margin-bottom: 10px;
}

.hero-section .tagline {
    font-size: 1.5em;
    color: var(--secondary-color);
    margin-bottom: 20px;
}

.hero-section .sub-headline {
    font-size: 1.1em;
    max-width: 700px;
    margin: 0 auto 40px auto;
}

/* Power of the Name Section */
.power-of-name-section {
    background-color: #fff;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.feature-item {
    background-color: var(--light-bg);
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.feature-item h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.5em;
}

/* Conceptual Demonstrations Section */
.demo-section {
    background-color: var(--light-bg);
    text-align: center;
}

.disclaimer {
    background-color: #ffffe0; /* Light yellow background */
    border: 1px solid #e0c200;
    padding: 20px;
    margin: 30px auto;
    max-width: 800px;
    border-radius: 8px;
    color: #806b00;
    font-size: 0.95em;
    text-align: left;
}

.disclaimer strong {
    color: #c00; /* Red for emphasis */
}

.demo-tabs {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.tab-button {
    background-color: #e9ecef;
    color: var(--secondary-color);
    border: none;
    padding: 12px 25px;
    border-radius: 5px 5px 0 0;
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 600;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.tab-button:hover {
    background-color: var(--border-color);
}

.tab-button.active {
    background-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
}

.demo-content {
    background-color: #fff;
    padding: 40px;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-top: -2px; /* Overlap with tabs border */
    text-align: left;
    display: none; /* Hidden by default, JavaScript shows active tab */
}

.demo-content.active {
    display: block;
}

.demo-content h3 {
    text-align: center;
    color: var(--dark-bg);
    margin-bottom: 20px;
}

.demo-placeholder {
    min-height: 400px; /* Give space for your demo */
    background-color: var(--light-bg);
    border: 1px dashed var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-style: italic;
    color: var(--secondary-color);
    margin: 30px 0;
    padding: 20px;
    border-radius: 5px;
}

.demo-strength {
    font-weight: 600;
    margin-top: 20px;
    border-top: 1px dashed var(--border-color);
    padding-top: 20px;
    text-align: center;
}

/* Your Opportunity Section */
.opportunity-section {
    background-color: var(--primary-color);
    color: #fff;
    text-align: center;
    padding: 80px 0;
}

.opportunity-section h2 {
    color: #fff;
    margin-bottom: 30px;
}

.opportunity-section p {
    font-size: 1.1em;
    max-width: 800px;
    margin: 0 auto 25px auto;
}

.opportunity-section .contact-info {
    margin-top: 25px;
    font-size: 1em;
}

.opportunity-section .contact-info a {
    color: #fff;
    text-decoration: underline;
}

/* Footer */
.footer {
    background-color: var(--dark-bg);
    color: #bbb;
    padding: 30px 0;
    text-align: center;
    font-size: 0.9em;
}

.footer a {
    color: #eee;
}

.footer .vibe-credit {
    margin-top: 10px;
    font-size: 0.8em;
    color: #888;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    h1 { font-size: 2.5em; }
    h2 { font-size: 2em; }
    .hero-section { padding: 80px 0; }
    .section { padding: 60px 0; }
    .btn { padding: 10px 20px; font-size: 0.9em; }
    .large-btn { font-size: 1.1em; padding: 12px 25px; }
    .features-grid { grid-template-columns: 1fr; }
    .demo-tabs { flex-direction: column; } /* Stack tabs on small screens */
    .tab-button { border-radius: 5px; width: 100%; }

    /* Adjust padding for the content area containing the demos */
    .demo-content {
        padding: 20px 10px; /* Reduce from 40px to 20px top/bottom, 10px left/right on mobile */
    }

    /* Adjust padding for the inner demo placeholder */
    .demo-placeholder {
        padding: 10px; /* Reduce from 20px to 10px all around on mobile */
    }

    /* Adjust padding for the treemap legend container */
    #treemap-legend-container {
        padding: 10px; /* Reduce from 15px to 10px on mobile */
    }

    /* Ensure the main container itself is not adding excessive padding */
    .container {
        padding: 0 10px; /* Further reduce overall container padding for tiny screens, from 15px to 10px */
    }

    .hero-section .domain-name {
        /*
         * This will override the 4em font-size specifically for screens <= 768px.
         * 9vw (9% of viewport width) should make it fluidly resize.
         * At 320px viewport width, 9vw = 28.8px, which should fit "sizemap.com".
         */
        font-size: 9vw; /* Adjust this value (e.g., 8vw, 7vw) if still overflowing */
        white-space: nowrap; /* Keep the text on a single line on mobile */
        /* Remove any 'overflow: hidden;' or 'text-overflow: ellipsis;' here too */
        padding: 0 5px; /* Reduce horizontal padding on mobile to give more room for text */
    }

    /* Ensure .container padding is also responsive if needed, but it should be fine */
    .container {
        padding: 0 15px; /* Slightly reduce overall container padding for small screens */
    }

    /* Your tagline might also need adjustment for better mobile display */
    .hero-section .tagline {
        font-size: clamp(1em, 4vw, 1.5em); /* Adjust vw slightly for better mobile fit if needed */
    }
}

/* Treemap Specific Styles */
#treemap-container {
    width: 100%;
    height: 500px; /* Adjust as needed */
    margin: 20px auto;
    border: 1px solid var(--border-color);
    background-color: #fff; /* Ensure white background for visualization */
    overflow: hidden; /* Prevent text overflow */
}

#treemap-container svg {
    display: block; /* Remove extra space below SVG */
}

.treemap-tooltip {
    opacity: 0;
    position: absolute;
    background-color: rgba(0,0,0,0.8);
    color: white;
    padding: 8px;
    border-radius: 4px;
    pointer-events: none; /* Allows mouse events to pass through to the elements below */
    font-size: 0.9em;
    z-index: 1000; /* Ensure tooltip is on top */
}

/* Make mock visualization areas visually distinct from the real one */
.mock-visualization {
    background-color: #f0f8ff !important; /* Override with !important if needed */
    border: 1px dashed #ccc !important;
    padding: 20px !important;
    text-align: center !important;
    min-height: 250px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    font-style: italic !important;
    color: #666 !important;
}

/* For the actual SVG elements generated by D3 */
rect {
    transition: all 0.2s ease-in-out;
}

/* Ensure text in SVG is readable */
text {
    pointer-events: none; /* Do not block mouse events for the rect */
    fill: white; /* Default text color in SVG rects */
    font-weight: bold;
    font-size: 10px;
}

/* Adjust legend text color for better contrast */
.treemap-legend text {
    fill: var(--text-color); /* Use your body text color or a dark color */
    font-weight: normal;
    font-size: 12px;
}

/* Leaflet Map Specific Styles */
/* Leaflet Map Specific Styles (for both real estate and e-commerce) */
#real-estate-map-container,
#ecommerce-map-container { /* Added #ecommerce-map-container */
    height: 500px; /* Essential for Leaflet map to show */
    width: 100%;
    margin: 20px auto;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* Style for Leaflet legend */
.info.legend {
    background: white;
    padding: 6px 8px;
    font: 14px/16px Arial, Helvetica, sans-serif;
    background-color: rgba(255,255,255,0.9);
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    border-radius: 5px;
}
.info.legend i {
    width: 18px;
    height: 18px;
    float: left;
    margin-right: 8px;
    opacity: 0.7;
    border-radius: 50%; /* Make legend squares circular like markers */
    border: 1px solid rgba(0,0,0,0.2);
}

/* Adjust demo-placeholder generic styles if needed, now that specific map styles are in place */
.demo-placeholder {
    /* Remove or adjust background/border styles that conflict with map */
    background-color: transparent; /* Or a very light gray to differentiate */
    border: none; /* Map will have its own border */
    padding: 0; /* Map fills the space */
    display: block; /* Leaflet likes to control its container */
    min-height: auto; /* Let map determine height */
}

/* Ensure mock-visualization is not applied to map container */
/* The renderRealEstateDemo now directly replaces the content, so this might not be needed */
.mock-visualization {
    display: none; /* Hide these from the map demo area now */
}

/* (Keep all your previous CSS styles) */

/* Add the following to your style.css */

/* Style for individual legend items */
.legend-item {
    display: flex; /* Make it a flex container */
    align-items: center; /* Vertically center items */
    margin-bottom: 5px; /* Spacing between legend items */
}

.info.legend i {
    /* Modify existing `i` rules */
    float: none; /* Remove float, as flexbox handles layout */
    width: 18px;
    height: 18px;
    margin-right: 8px;
    opacity: 0.7;
    border-radius: 50%; /* Make legend squares circular like markers */
    border: 1px solid rgba(0,0,0,0.2);
    flex-shrink: 0; /* Prevent the swatch from shrinking */
}

.info.legend span {
    /* Style for the text part of the legend item */
    font-size: 14px;
    line-height: 1.2; /* Adjust line height if necessary for perfect vertical centering */
}

/* Treemap Legend Specific Styling */
#treemap-legend-container {
    margin-top: 30px; /* Add some space between the Treemap and its legend */
    text-align: left; /* Align legend items to the left within its container */
    padding: 15px; /* Add some padding around the legend */
    background-color: var(--light-bg); /* Give it a light background */
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); /* Subtle shadow */
}

/* Ensure common legend styles apply */
.info.legend {
    /* Existing styles: background, padding, font, etc. */
    /* Make sure these base styles are appropriate for the Treemap legend too */
    max-width: 100%; /* Ensure it doesn't overflow */
    margin-left: auto;
    margin-right: auto; /* Center if less than 100% width */
}

.main-logo-icon {
    /*
     * Fluid width: Scales from a minimum of 60px up to a maximum of 120px,
     * with 15% of viewport width as the preferred size.
     */
    width: clamp(60px, 15vw, 120px);
    height: auto; /* Maintain aspect ratio */
    display: block; /* Makes it a block element to center with margin */
    margin: 0 auto 20px auto; /* Centers horizontally, adds space below */
    max-width: 90%; /* Ensures it doesn't overflow its parent on very small screens */
}