/* FONT IMPORT */
@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@700&family=Montserrat:wght@400;500;600&display=swap');

/* BASIC RESET & THEME - Consistent with other pages */
:root {
    --primary-green: #556b2f;
    --dark-green: #2e4034;
    --background-dark: #1a2a26;
    --text-light: #f2f2f2;
    --text-muted: #a0a0a0;
    --border-color: rgba(255, 255, 255, 0.15);
    --module-bg: rgba(255, 255, 255, 0.05);
    --module-bg-hover: rgba(255, 255, 255, 0.1);
    --action-blue: #3498db; /* A distinct color for friend actions */
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--background-dark);
    color: var(--text-light);
    margin: 0;
    /* Match global fixed header spacing so content doesn't sit under the header */
    padding-top: 120px;
}

/* BACKGROUND STYLES (shared pattern) */
#background-cycler {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background-size: cover;
    background-position: center;
    transition: background-image 1.5s ease-in-out;
}
.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(26, 42, 38, 0.9), rgba(26, 42, 38, 0.7));
    z-index: -1;
}

/* MAIN LAYOUT & PAGE HEADER */
.page-container {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 20px;
}
.page-header {
    text-align: center;
    margin-bottom: 2.5rem;
}
.page-header h1 {
    font-family: 'Merriweather', serif;
    font-size: 3rem;
    margin: 0 0 0.5rem 0;
}
.page-header .subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* SEARCH MODULES */
.search-module, .results-module {
    background-color: var(--module-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}
.search-module h2, .results-module h2 {
    margin-top: 0;
    font-family: 'Merriweather', serif;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

/* FILTER CONTROLS */
.filter-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.filter-controls input[type="search"] {
    flex-grow: 1;
    padding: 10px 15px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background-color: rgba(0,0,0,0.2);
    color: var(--text-light);
    font-size: 1rem;
    transition: border-color 0.3s;
}
.filter-controls input[type="search"]:focus {
    outline: none;
    border-color: var(--primary-green);
}

/* TAXONOMY BROWSER: BREADCRUMB */
.breadcrumb-container {
    padding: 10px;
    background-color: rgba(0,0,0,0.15);
    border-radius: 5px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.breadcrumb-container a {
    color: var(--action-blue);
    text-decoration: none;
    font-weight: 500;
}
.breadcrumb-container a:hover {
    text-decoration: underline;
}
.breadcrumb-container span {
    margin: 0 8px;
    color: var(--text-muted);
}

/* TAXONOMY BROWSER: LIST */
.taxon-list-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 50px; /* Ensures it has height even when empty */
}
.taxon-item {
    background-color: rgba(0,0,0,0.2);
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    font-weight: 500;
    border: 1px solid transparent;
}
.taxon-item:hover {
    background-color: var(--primary-green);
    color: white;
}
.taxon-item.selected {
    background-color: var(--action-blue);
    color: white;
    border-color: var(--text-light);
}

/* RESULTS GRID */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}
.loading-text, .no-results-text {
    color: var(--text-muted);
    text-align: center;
    padding: 2rem;
    grid-column: 1 / -1; /* Span all columns */
    font-size: 1.1rem;
}

/* USER CARD */
.user-card {
    background-color: rgba(0,0,0,0.25);
    border-radius: 8px;
    padding: 1.5rem 1rem;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border-color);
}
.user-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}
.user-card img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin-bottom: 1rem;
    object-fit: cover;
    border: 3px solid var(--border-color);
}
.user-card h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
    font-weight: 600;
}
.user-card .location {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    min-height: 1.2em; /* Prevent layout shift if location is missing */
}
.user-card .add-friend-btn {
    background-color: var(--action-blue);
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    border: none;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.2s;
}
.user-card .add-friend-btn:hover {
    background-color: #2980b9;
}
.user-card .add-friend-btn.pending,
.user-card .add-friend-btn.friends {
    background-color: #555;
    cursor: not-allowed;
}

/* PAGINATION CONTROLS */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 2rem;
    gap: 1rem;
}
.pagination-controls button {
    background-color: var(--primary-green);
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-weight: bold;
}
.pagination-controls button:disabled {
    background-color: #555;
    cursor: not-allowed;
}
#page-info {
    font-weight: 500;
}