/* Minimal Black & White Design */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
    color: #000;
    background: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    padding: 60px 0;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    padding: 20px 0;
    border-bottom: 1px solid #000;
}

.logo {
    color: #000;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.5px;
}

/* Search Page */
.search-section {
    max-width: 500px;
    margin: 0 auto;
    padding-bottom: 40vh; /* Extra space for mobile keyboard */
    text-align: center;
}

.search-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 10px;
    text-align: center;
}

.search-section .lead-text {
    font-size: 1.1rem;
    color: #444;
    text-align: center;
    margin-bottom: 40px;
}

.hidden {
    display: none !important;
}

.search-skeleton {
    display: grid;
    gap: 1rem;
    padding: 1.75rem 1.25rem;
    border: 1px solid #e2e2e2;
    border-radius: 18px;
    background: #fafafa;
    animation: fadeIn 0.25s ease-out;
    margin-bottom: 30px;
}

.skeleton-line {
    height: 18px;
    border-radius: 999px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e5e5e5 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite ease-in-out;
}

.skeleton-line.title {
    width: 70%;
    height: 24px;
}

.skeleton-line:not(.title) {
    width: 100%;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.search-form {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group input {
    width: 100%;
    padding: 12px 0;
    font-size: 1.1rem;
    border: none;
    border-bottom: 2px solid #000;
    background: transparent;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-bottom-color: #000;
}

.btn-primary {
    background: #000;
    color: #fff;
    padding: 12px 30px;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: opacity 0.2s;
    border-radius: 999px;
}

.btn-primary:hover {
    opacity: 0.8;
}

.cache-info {
    font-size: 0.8rem;
    color: #666;
    text-align: center;
    margin-top: 20px;
}

.speed-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #f0f0f0;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 1rem auto 0;
    color: #333;
    text-align: center;
    max-width: 300px;
    width: max-content;
}

.speed-icon {
    font-size: 1rem;
}

.search-time {
    font-weight: 700;
    color: #0a7a3a;
    white-space: nowrap;
}

.footer-speed {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.5rem;
}

/* Flash Messages */
.flash-messages {
    margin-bottom: 30px;
}

.flash {
    padding: 12px;
    font-size: 0.9rem;
    margin-bottom: 10px;
    border-left: 3px solid #000;
    background: #f5f5f5;
}

/* Results Page */
.results-section {
    max-width: 700px;
    margin: 0 auto;
}

.results-header {
    margin-bottom: 0.75rem;
}

.results-section h1 {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.5px;
    white-space: nowrap;
}

.share-icon {
    width: auto;
    height: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    color: #000 !important;
    font-size: 0.95rem;
    padding: 0;
    cursor: pointer;
    transition: transform 0.2s, color 0.2s;
    margin-left: 0;
    appearance: none;
    -webkit-appearance: none;
    box-shadow: none !important;
    outline: none;
}

.share-icon:hover,
.share-icon:focus {
    background: transparent !important;
    background-color: transparent !important;
    color: #000 !important;
    transform: translateY(-1px);
    outline: none;
}

.cache-info {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 30px;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    padding: 0.85rem 1.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    color: #000;
    background: #f4f4f4;
    border: 1px solid #ccc;
    border-radius: 999px;
    transition: background 0.2s, border-color 0.2s;
}

.btn-secondary:hover {
    background: #e9e9e9;
    border-color: #999;
}

.results-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.action-right {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .results-actions {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.jump-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .jump-links {
        flex-direction: row;
        gap: 0.75rem;
    }
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 999px;
    transition: opacity 0.2s, transform 0.2s;
}

.btn-action:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

.btn-action.btn-primary {
    background: #000;
    color: #fff;
    border: none;
}

.btn-action.btn-secondary {
    background: #f4f4f4;
    color: #000;
    border: 1px solid #ccc;
}

.result-summary {
    margin-bottom: 1rem;
    color: #444;
    font-size: 0.95rem;
}

.results-footer {
    margin-top: 2rem;
    margin-bottom: 10px;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    align-items: center;
}

.results-footer .cache-info {
    margin-bottom: 0;
    font-size: 0.9rem;
    color: #666;
}

.station-card {
    padding: 20px 0;
    border-bottom: 1px solid #000;
}

.station-card:last-child {
    border-bottom: none;
}

.station-card h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    letter-spacing: -0.3px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.station-heading-text {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.station-postcode {
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
}

.distance {
    font-size: 0.85rem;
    font-weight: 400;
    color: #666;
}

.postcode {
    margin-bottom: 15px;
    color: #444;
    font-size: 0.9rem;
}

.maps-link {
    display: inline-flex;
    margin-left: 0;
    padding: 0;
    font-size: 0.85rem;
    color: inherit;
    text-decoration: none !important;
}

.maps-link:hover,
.maps-link:focus {
    text-decoration: none !important;
}

.maps-link:visited {
    color: inherit;
    text-decoration: none !important;
}

.prices {
    display: flex;
    gap: 30px;
}

.price-item {
    min-width: 120px;
}

.fuel-type {
    display: block;
    font-size: 0.75rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #000;
}

.price.na {
    color: #999;
    font-size: 1rem;
}

.back-link {
    margin-top: 40px;
}

.back-link a {
    color: #000;
    text-decoration: none;
    font-size: 0.9rem;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.back-link a:hover {
    border-bottom-color: #000;
}

/* Footer */
footer {
    padding: 30px 0;
    margin-top: 40px;
    border-top: 1px solid #000;
    text-align: center;
    background: #000;
    color: #fff;
}

.footer-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.footer-nav a {
    color: #fff;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
}

.footer-nav a:hover {
    text-decoration: underline;
    opacity: 0.8;
}

.footer-source {
    font-size: 0.75rem;
    color: #ccc;
    margin-top: 0.5rem;
}

.footer-source a {
    color: #ccc;
}

.footer-source a:hover {
    opacity: 0.8;
}

.footer-contact {
    font-size: 0.75rem;
    color: #ccc;
    margin-top: 0.25rem;
}

.footer-contact a {
    color: #ccc;
}

.footer-contact a:hover {
    opacity: 0.8;
}

/* Info Pages (About, FAQ, Contact, Terms) */
.info-section {
    max-width: 700px;
    margin: 0 auto;
}

.info-section h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 1.5rem;
}

.info-section h2 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    letter-spacing: -0.5px;
}

.info-section .lead {
    font-size: 1.1rem;
    color: #444;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.info-section p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.info-section ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.info-section li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.info-section a {
    color: #000;
    text-decoration: underline;
}

.info-section a:hover {
    opacity: 0.7;
}

.faq-item {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #eee;
}

.faq-item:last-child {
    border-bottom: none;
}

.contact-details {
    background: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.contact-details p {
    margin: 0;
}

/* Stations List */
.stations-list {
    display: grid;
    gap: 1.5rem;
}

.station-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.station-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.results-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.btn-action {
    padding: 0.85rem 1.5rem;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.result-summary {
    margin-bottom: 1.5rem;
    color: #444;
    font-size: 0.95rem;
}

.station-card.cheapest-petrol-card {
    border: 2px solid #0a7f3d;
}

.station-card.cheapest-diesel-card {
    border: 2px solid #005a9c;
}

.station-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.85rem;
}

.badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.4rem 0.65rem;
    border-radius: 999px;
}

.badge-petrol {
    background: #d9f2e1;
    color: #0a7f3d;
}

.badge-diesel {
    background: #dbe9f7;
    color: #005a9c;
}

.station-card h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    letter-spacing: -0.3px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.postcode {
    color: #666;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.prices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.price-item {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
}

.fuel-type {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.price {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1a1a2e;
}

.price.na {
    color: #999;
    font-size: 1rem;
}

.last-updated {
    font-size: 0.85rem;
    color: #999;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.back-link {
    margin-top: 2rem;
    text-align: center;
}

.back-link a {
    color: #1a1a2e;
    text-decoration: none;
}

.back-link a:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    background: #1a1a2e;
    color: white;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: auto;
}

footer p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .search-section {
        margin: 1rem;
        padding: 2rem 1rem;
    }
    
    .prices {
        grid-template-columns: 1fr 1fr;
    }
    
    .station-card {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .prices {
        grid-template-columns: 1fr;
    }
}

/* Admin search log */
.admin-search-log h1 { margin-bottom: 1rem; }
.admin-search-log .stats { display:flex; gap:1.5rem; margin-bottom:1rem; flex-wrap:wrap; }
.admin-search-log .stat { font-size: 0.95rem; }
.admin-search-log .stat.success strong { color:#0a7a3a; }
.admin-search-log .stat.failed strong { color:#a3190f; }
.admin-search-log .filters { display:flex; gap:0.5rem; flex-wrap:wrap; margin-bottom:1rem; }
.admin-search-log .filters input, .admin-search-log .filters select, .admin-search-log .filters button {
    padding: 0.4rem 0.6rem; border:1px solid #000; background:#fff; color:#000; font: inherit;
}
.admin-search-log .filters button { cursor:pointer; background:#000; color:#fff; }
.search-log-table { width:100%; border-collapse:collapse; font-size:0.9rem; }
.search-log-table th, .search-log-table td { border-bottom:1px solid #ddd; padding:0.4rem 0.6rem; text-align:left; vertical-align:top; }
.search-log-table th { background:#f4f4f4; }
.search-log-table .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size:0.8rem; }
.search-log-table .ua { max-width: 260px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.search-log-table tr.row-success td { background:#f4fbf6; }
.search-log-table tr.row-failed td { background:#fbf4f4; }
.badge { display:inline-block; padding:0.1rem 0.4rem; border-radius:3px; font-size:0.75rem; }
.badge.success { background:#0a7a3a; color:#fff; }
.badge.failed { background:#a3190f; color:#fff; }
.pager { display:flex; justify-content:space-between; margin-top:1rem; }
.pager a { color:#000; text-decoration:underline; }
