/* --- General Setup & Typography --- */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

/* Dark Theme Color Palette */
:root {
    --primary-color: #0a9396; /* Teal for headers */
    --secondary-color: #90cdf4; /* Light blue for links */
    --accent-color: #ee9b00;
    --background-color: #1a202c; /* Dark blue-gray */
    --surface-color: #2d3748; /* Slightly lighter for cards/forms */
    --text-color: #e2e8f0; /* Light gray for main text */
    --text-muted-color: #a0aec0; /* Softer gray for secondary text */
    --border-color: #4a5568; /* Border color */
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.main-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 2em;
}

h1, h2 {
    color: var(--primary-color);
}

a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

a:hover {
    color: var(--accent-color);
}

/* --- Header/Back Link --- */
.back-link {
    display: inline-block;
    margin-bottom: 0.1em;
    font-weight: bold;
}

/* --- Forms & Buttons --- */
form {
    display: flex;
    flex-direction: column;
    gap: 1em;
    background: var(--surface-color);
    padding: 1.5em;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

input, select, textarea, button {
    padding: 12px;
    font-size: 1em;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

textarea {
    resize: vertical;
    min-height: 10px;
}

button[type="submit"] {
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s ease-in-out;
}

button[type="submit"]:hover {
    background-color: var(--accent-color);
}

.approve-button {
    background-color: #38a169 !important; /* Green for approve */
}
.approve-button:hover {
    background-color: #2f855a !important;
}

.reject-button {
    background-color: #c53030 !important; /* Red for reject/delete */
}
.reject-button:hover {
    background-color: #9b2c2c !important;
}

.action-buttons-container {
    display: flex;
    gap: 1em;
    margin-top: 1.5em;
}
.action-buttons-container button {
    padding: 8px 16px; /* Make buttons smaller */
    font-size: 0.9em;
}

.notification-links {
    margin-top: 1.5em;
    text-align: left; /* Align links to the left */
    font-size: 0.9em;
    padding-left: 0.5em; /* Add slight padding */
}
.notification-links a {
    display: inline-block;
    padding: 4px 12px;
    border: 1px solid var(--border-color);
    border-radius: 12px; /* Pill shape */
    margin: 0 0.25em;
    transition: background-color 0.2s ease;
}
.notification-links a:hover {
    background-color: var(--border-color);
    color: var(--text-color);
}


.submission-details {
    margin-bottom: 2em;
    font-size: 0.9em;
    color: var(--text-muted-color);
    line-height: 1.5;
}

/* --- Homepage: Hero Section --- */
.hero-section {
    text-align: center;
    padding: 1.5em 2em;
    background-color: var(--background-color); /* Slightly different from surface for contrast */
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 2.5em;
    font-size: 1.1em;
    line-height: 1.7;
}

/* --- Homepage: Search and Site Cards --- */
.search-container {
    margin-bottom: 2em;
}

#search-box {
    width: 100%;
    border-radius: var(--border-radius);
}

.submission-prompt {
    text-align: center;
    margin-bottom: 2em;
    padding: 1em;
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
}
#sites-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5em;
    list-style: none;
    padding: 0;
}

#sites-list li {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

#sites-list li:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.review-list .review-card {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 1.5em;
    list-style: none;
}

.review-card.exists {
    border: 2px solid #38a169; /* Green border for existing sites */
}

.review-list .card-header {
    font-size: 1.3em;
    font-weight: bold;
    color: var(--secondary-color);
    margin-bottom: 1em;
}

/* --- Admin Message Review --- */
.message-list {
    list-style: none;
    padding: 0;
    display: grid;
    gap: 1.5em;
}

.message-card {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 1.5em;
}

.message-timestamp {
    font-size: 0.8em;
    color: var(--text-muted-color);
}

.message-container {
    max-height: 500px; /* Set a max height for scrolling */
}

.message-card.read {
    opacity: 0.6;
    border-left: 4px solid var(--primary-color);
}

.message-actions {
    margin-top: 1em;
    display: flex;
    gap: 1em;
    align-items: center;
}

.message-actions form {
    padding: 0;
    background: none;
    box-shadow: none;
}

.action-button {
    padding: 6px 12px;
    font-size: 0.9em;
}

#sites-list a {
    display: block;
    padding: 1.5em;
    font-size: 1.2em;
    font-weight: bold;
}

.site-name {
    display: block;
}

.site-country {
    display: block;
    font-size: 0.9em;
    font-weight: normal;
    color: var(--text-muted-color);
    margin-top: 0.25em;
}

.site-distance {
    font-size: 0.9em;
    color: var(--text-muted-color);
    font-weight: normal;
    display: block;
    margin-top: 0.25em;
}

/* --- Site Detail Page --- */
#map {
    height: 100%;
    width: 100%;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.site-header {
    margin-bottom: 1em;
}

.site-country-large {
    font-size: 1.2em;
    color: var(--text-muted-color);
    display: block;
    margin-top: -0.5em;
    margin-bottom: 1em;
}

.site-main-content {
    display: grid;
    grid-template-columns: 1fr; /* Default to single column for mobile */
    gap: 2.5em;
    margin-top: 2em;
}

@media (min-width: 768px) { /* Apply two-column layout on larger screens */
    .site-main-content {
        grid-template-columns: 2fr 1fr; /* 2/3 for map, 1/3 for form */
    }
    .map-widget {
        min-height: 0; /* Remove min-height to allow natural grid alignment on desktop */
    }
}

.map-widget {
    min-height: 400px; /* Ensure map is visible on mobile (single-column) view */
}

.conditions-container {
    margin-top: 3em;
}

/* --- Footer --- */
footer {
    text-align: center;
    margin-top: 2.5em;
    padding-top: 2em;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1em;
}

.footer-content {
    font-size: 0.9em;
    color: var(--text-muted-color);
}

.bmc-button {
    height: 45px !important;
    width: auto !important;
}

/* --- Utility Classes --- */
.error-message {
    color: #f56565; /* A reddish color for errors */
    background-color: rgba(245, 101, 101, 0.1);
    padding: 1em;
    border-radius: var(--border-radius);
    border: 1px solid #f56565;
}

/* --- Loading Spinner --- */
#status-message {
    color: var(--text-muted-color);
    font-style: italic;
    text-align: center;
    margin-top: 4em;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.spinner {
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  border-top: 4px solid var(--secondary-color);
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin-bottom: 1em;
}

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

/* --- Site Page: Report Cards --- */
.comment-list {
    list-style-type: none;
    padding: 0;
    margin-top: 1.5rem;
    display: grid;
    gap: 1rem;
}

.comment-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: var(--box-shadow);
    transition: box-shadow 0.2s ease-in-out;
}

.comment-card:hover {
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.card-header {
    display: grid;
    grid-template-columns: 1fr auto; /* Content on left, timestamp on right */
    align-items: start; /* Align items to the top of the row */
    gap: 0.5rem 1rem; /* Gap between rows and columns */
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
}

.header-main {
    flex-grow: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-aside {
    flex-shrink: 0;
    text-align: right;
}

.report-details {
    font-size: 0.9em;
    color: var(--text-muted-color);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.report-details span {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
}

/* Common styles for icons using background images */
.report-details span::before {
    content: "";
    display: inline-block;
    width: 1.1em;  /* Set a consistent width */
    height: 1.1em; /* Set a consistent height */
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.report-details span:nth-child(1)::before {
    background-image: url("eye.svg");
}

.report-details span:nth-child(2)::before {
    background-image: url("current.svg");
}

.comment-timestamp {
    font-size: 0.85em;
    color: var(--text-muted-color);
}

.card-body {
    padding-top: 0.5rem;
}

.card-body p {
    margin: 0;
    font-style: italic;
    color: var(--text-muted-color);
}
