/* LocalPulse AI - style.css - Iteration 2 */

/* Basic Reset & Box-Sizing */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Global Body Styles - User-Centric Interface foundation */
body {
    font-family: 'Inter', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color, #333);
    background-color: var(--background-light, #f9fbfd);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center; /* Center content block horizontally */
    justify-content: flex-start; /* Start content from the top */
    padding: 20px; /* Overall padding around the main content block */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* A conceptual color palette using CSS variables for future use */
:root {
    --primary-color: #0056b3; /* Darker blue for primary actions/headings */
    --primary-light: #007bff; /* Lighter blue for links/interactive elements */
    --secondary-color: #28a745; /* Green for positive sentiment/success */
    --accent-color: #ffc107; /* Yellow for warnings/highlights */
    --danger-color: #dc3545; /* Red for negative sentiment/errors */
    --info-color: #17a2b8; /* Cyan for informational alerts */
    --text-color: #333; /* Dark text for readability */
    --text-light: #666; /* Lighter text for secondary information */
    --background-light: #f9fbfd; /* Very light background */
    --background-medium: #e9ecef; /* Slightly darker background for sections/cards */
    --border-color: #dee2e6; /* Light grey border */
    --shadow-light: rgba(0, 0, 0, 0.08); /* Light shadow for cards/sections */
    --shadow-medium: rgba(0, 0, 0, 0.12); /* Medium shadow for interactive elements */
}

/* Main Layout Structure */
header, main, footer {
    width: 100%;
    max-width: 1000px; /* Constrain content width for readability */
    margin-bottom: 20px; /* Spacing between main layout sections */
}

header {
    text-align: center;
    padding: 20px 0;
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px var(--shadow-light);
}

main {
    flex-grow: 1; /* Allow main content to take available vertical space */
    padding: 0 20px; /* Internal padding for main content area */
}

footer {
    text-align: center;
    padding: 20px 0;
    color: var(--text-light);
    font-size: 0.9em;
    border-top: 1px solid var(--border-color);
    margin-top: 30px;
}

/* Typography */
h1 {
    font-size: 2.8em;
    color: var(--primary-color);
    margin-bottom: 0.2em;
    line-height: 1.2;
}

.tagline { /* Specific style for header tagline */
    font-size: 1.2em;
    color: var(--text-light);
    margin-top: 0;
    margin-bottom: 1em;
    font-weight: 300;
}

h2 {
    font-size: 2em;
    color: var(--primary-color);
    margin-bottom: 1em;
    text-align: center;
    padding-top: 15px; /* Spacing from the top of the section */
}

h3 {
    font-size: 1.4em;
    color: var(--primary-color);
    margin-bottom: 0.8em;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

p {
    font-size: 1.1em;
    margin-bottom: 1em;
    text-align: left; /* Default paragraphs are left-aligned */
    max-width: none; /* Override previous max-width if any */
}

p + p { /* Add extra space between consecutive paragraphs */
    margin-top: 0.5em;
}

ul {
    list-style: none; /* Remove default bullet points */
    padding-left: 0;
    margin-bottom: 1em;
}

ul li {
    position: relative;
    padding-left: 25px; /* Space for custom bullet */
    margin-bottom: 0.5em;
    font-size: 1.05em;
}

ul li::before {
    content: '•'; /* Custom bullet point */
    color: var(--primary-color);
    position: absolute;
    left: 0;
    font-size: 1.2em;
    line-height: 1.6; /* Align custom bullet with text */
}

/* Basic Link Styling */
a {
    color: var(--primary-light);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Section Styling */
section {
    background-color: #fff;
    padding: 30px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow-light);
}

/* Specific Section Styles */
#key-features ul li strong,
#design-principles ul li strong {
    color: var(--primary-color);
}

#technical-stack {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    padding-top: 0;
}

#technical-stack h2 {
    grid-column: 1 / -1; /* Make h2 span all columns in the grid */
    margin-bottom: 1em;
}

.tech-stack-category {
    background-color: var(--background-light);
    padding: 20px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.tech-stack-category h3 {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0.5em;
}

.tech-stack-category ul {
    margin-bottom: 0;
}

/* Form Elements - Inputs, Selects, Buttons */
.input-group {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap; /* Allow elements to wrap on smaller screens */
}

.input-group label {
    font-weight: bold;
    color: var(--text-color);
    flex-shrink: 0; /* Prevent label from shrinking */
}

.input-group input[type="text"],
.input-group select,
.input-group input[type="date"],
.filter-input,
.filter-select {
    flex-grow: 1; /* Allow input/select to grow and take available space */
    max-width: 400px; /* Max width for input field */
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1em;
    color: var(--text-color);
    background-color: #fff;
    -webkit-appearance: none; /* Remove default styling for select/date inputs */
    -moz-appearance: none;
    appearance: none;
}

.input-group input[type="text"]:focus,
.input-group select:focus,
.input-group input[type="date"]:focus,
.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25); /* Focus ring */
}

/* Custom arrow for select */
.input-group select, .filter-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23666666'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 30px; /* Make space for the custom arrow */
}

button, .primary-btn {
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    flex-shrink: 0; /* Prevent button from shrinking */
}

button:hover, .primary-btn:hover {
    background-color: var(--primary-light);
    transform: translateY(-1px); /* Subtle lift effect */
    box-shadow: 0 4px 8px var(--shadow-medium);
}

button:active, .primary-btn:active {
    transform: translateY(0); /* Return to original position on click */
    box-shadow: 0 2px 4px var(--shadow-light);
}

button:focus, .primary-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.5); /* Focus ring for accessibility */
}

.secondary-btn {
    background-color: var(--background-medium); /* Lighter background for secondary actions */
    color: var(--primary-color);
    border: 1px solid var(--border-color);
}

.secondary-btn:hover {
    background-color: var(--border-color);
    color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px var(--shadow-light);
}

.secondary-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.secondary-btn:focus {
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.5);
}


/* Geo Area Definition Section */
#geo-area-definition {
    text-align: center;
}

#geo-area-definition h2 {
    margin-bottom: 1.5em;
}

#map-placeholder {
    height: 300px;
    background-color: var(--background-medium);
    border: 1px dashed var(--border-color);
    margin-top: 15px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column; /* Stack text content vertically */
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-style: italic;
    border-radius: 8px;
    text-align: center;
    padding: 20px;
    line-height: 1.4;
}

#current-area-display, .current-area-info {
    font-weight: bold;
    color: var(--primary-color);
    margin-top: 10px;
    font-size: 1.1em;
    text-align: center;
}

/* Dashboard Section */
#dashboard-container h2 {
    margin-bottom: 1.5em;
}

.dashboard-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    align-items: center;
    background-color: var(--background-medium);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: inset 0 1px 3px var(--shadow-light);
}

.dashboard-filters label {
    font-weight: bold;
    color: var(--text-color);
}

.dashboard-filters .filter-input,
.dashboard-filters .filter-select {
    max-width: 180px; /* Smaller width for filters */
    flex-basis: auto; /* Allow items to determine their own width */
}

.dashboard-filters button {
    margin-left: 10px;
}

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

.dashboard-card {
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow-light);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Distribute space evenly */
}

.dashboard-card h3 {
    color: var(--primary-color);
    font-size: 1.25em;
    margin-bottom: 1em;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.dashboard-card p {
    margin-bottom: 0.8em;
    font-size: 1em;
}

.dashboard-card p span {
    font-weight: bold;
    color: var(--primary-color); /* Default span color */
}

/* Sentiment specific colors (assuming data-sentiment attribute is set by JS) */
#overall-sentiment[data-sentiment="Positive"],
#overall-sentiment[data-sentiment="Neutral-Positive"] {
    color: var(--secondary-color);
}
#overall-sentiment[data-sentiment="Neutral"] {
    color: var(--accent-color);
}
#overall-sentiment[data-sentiment="Negative"] {
    color: var(--danger-color);
}

.dashboard-card ul {
    margin-top: 0.5em;
    flex-grow: 1; /* Allow lists to take available height */
}

.dashboard-card ul li {
    font-size: 0.95em;
    margin-bottom: 0.3em;
    padding-left: 20px;
}

.dashboard-card ul li::before {
    font-size: 1em;
    line-height: 1.5;
}

.dashboard-card .chart-placeholder {
    height: 150px;
    background-color: var(--background-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    border-radius: 4px;
    font-style: italic;
    margin-top: 10px;
}

.dashboard-card .view-sources-link {
    display: block;
    text-align: right;
    margin-top: 15px;
    font-size: 0.9em;
}

.dashboard-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* Alerts & Notifications Section */
#alerts-notifications {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

#alerts-notifications h2 {
    grid-column: 1 / -1;
    margin-bottom: 1.5em;
}

.alert-settings, .recent-notifications {
    background-color: var(--background-light);
    padding: 25px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px var(--shadow-light);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.alert-settings h3, .recent-notifications h3 {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 1em;
}

.alert-settings p {
    margin-bottom: 1.5em;
}

.recent-notifications ul {
    margin-bottom: 0;
    flex-grow: 1;
}

.recent-notifications ul li {
    font-size: 1em;
    margin-bottom: 0.8em;
    padding-left: 20px;
    color: var(--text-light);
}

.recent-notifications ul li::before {
    content: '🔔'; /* Bell icon for notifications */
    color: var(--info-color);
    font-size: 0.9em;
    top: 0;
}

/* Advanced Search & Filtering Section */
#advanced-search .search-input-group {
    margin-bottom: 20px;
    flex-wrap: nowrap; /* Keep search input and button together */
}

#advanced-search .search-input-group input[type="text"] {
    max-width: none; /* Allow search input to take full width */
}

.search-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: flex-start;
    align-items: center;
    background-color: var(--background-medium);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: inset 0 1px 3px var(--shadow-light);
}

.search-filters label {
    font-weight: bold;
    color: var(--text-color);
    flex-shrink: 0;
}

.search-filters .filter-select {
    max-width: 150px;
}

.search-filters button {
    margin-left: auto; /* Push "More Filters" button to the right */
}

.search-results h3 {
    margin-bottom: 1em;
}

.search-results ul {
    margin-bottom: 0;
}

.search-results ul li {
    font-size: 1em;
    margin-bottom: 1em;
    padding-left: 0; /* Remove custom bullet */
    border-bottom: 1px dotted var(--border-color);
    padding-bottom: 0.8em;
}

.search-results ul li:last-child {
    border-bottom: none;
}

.search-results ul li::before {
    content: none; /* Remove custom bullet */
}

.search-results ul li span {
    font-weight: bold;
    color: var(--primary-color);
}

.search-results ul li a {
    font-size: 0.9em;
    margin-left: 10px;
    white-space: nowrap; /* Keep source link on one line */
}


/* Responsive Adjustments */
@media (max-width: 768px) {
    body {
        padding: 20px 10px;
    }

    h1 {
        font-size: 2.2em;
    }

    .tagline {
        font-size: 1.1em;
    }

    h2 {
        font-size: 1.8em;
    }

    h3 {
        font-size: 1.3em;
    }

    p {
        font-size: 1em;
    }

    section {
        padding: 20px;
    }

    .input-group {
        flex-direction: column;
        align-items: stretch;
    }

    .input-group input[type="text"],
    .input-group select,
    .input-group input[type="date"],
    .filter-input,
    .filter-select {
        max-width: 100%;
    }

    .dashboard-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-filters button {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
    }

    .dashboard-grid {
        grid-template-columns: 1fr; /* Stack dashboard cards on smaller screens */
    }

    .dashboard-actions {
        flex-direction: column;
        align-items: stretch;
    }

    #alerts-notifications {
        grid-template-columns: 1fr;
    }

    .search-filters {
        flex-direction: column;
        align-items: stretch;
    }
    .search-filters button {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.8em;
    }

    .tagline {
        font-size: 1em;
    }

    h2 {
        font-size: 1.5em;
    }

    button, .primary-btn, .secondary-btn {
        width: 100%; /* Full width buttons on very small screens */
    }
}