/* Tidepooling.org Custom Styles */
/* "Homemade but beautiful" aesthetic with Pico CSS */

:root {
    /* Primary - teal (existing brand color) */
    --pico-primary: #1a5f7a;
    --pico-primary-hover: #145a6e;
    --pico-primary-focus: rgba(26, 95, 122, 0.25);
    --pico-primary-inverse: #fff;
    --text-on-primary: rgba(255, 255, 255, 0.85);  /* Softer white for secondary text on teal */

    /* Warm accent - sunset/tidepool feel */
    --accent: #e07850;
    --accent-light: #f4a261;

    /* Warm background instead of stark white */
    --pico-background-color: #faf9f7;
    --pico-card-background-color: #ffffff;

    /* Typography */
    --font-heading: 'Nunito', sans-serif;
    --pico-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Softer shadows */
    --pico-card-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);

    /* Slightly warmer text */
    --pico-color: #2d3436;
    --pico-muted-color: #636e72;
}

/* Headings use Nunito */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--pico-primary);
}

/* Site header */
.site-header {
    background: var(--pico-primary);
    padding: 0.5rem 0;
    margin-bottom: 0;
    border-bottom: 3px solid var(--accent);
}

.site-header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-header nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

.site-header nav a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.95rem;
}

.site-header nav a:hover {
    color: #fff;
}

.site-logo {
    font-family: var(--font-heading);
    font-size: 1.25rem !important;
    color: #fff !important;
}

/* Footer */
.footer-text {
    text-align: center;
    font-size: 0.875rem;
    color: var(--pico-muted-color);
    padding: 1rem 0;
}

.footer-text a {
    color: var(--pico-muted-color);
}

/* Hero section for home page */
.hero {
    text-align: center;
    padding: 0.5rem 0 0.5rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--pico-primary);
}

.hero .tagline {
    font-size: 1.25rem;
    color: var(--pico-muted-color);
    margin-bottom: 0.5rem;
}

/* Coral accent underline below tagline */
.hero .tagline::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--accent);
    margin: 0.75rem auto 0;
    border-radius: 2px;
}

/* Search box styling */
.search-box {
    background: var(--pico-card-background-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--pico-card-box-shadow);
    margin-bottom: 2rem;
}

.search-box h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--pico-color);
}

/* Recent locations section */
.recent-locations {
    margin-bottom: 0.75rem;
}

.recent-locations h3 {
    font-size: 1rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
    margin-top: 0;
}

.recent-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.recent-chip {
    display: inline-block;
    background: var(--pico-card-background-color);
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
    text-decoration: none;
    color: var(--pico-color);
    transition: all 0.2s;
}

.recent-chip:hover {
    background: var(--pico-primary);
    color: white;
    border-color: var(--pico-primary);
}

/* Location cards grid */
.location-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.location-card {
    background: var(--pico-card-background-color);
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: var(--pico-card-box-shadow);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
    display: block;
}

.location-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    border-left: 3px solid var(--accent);
}

.location-card h3 {
    font-size: 1.1rem;
    margin: 0 0 0.5rem 0;
    color: var(--pico-primary);
}

.location-card .location-meta {
    font-size: 0.9rem;
    color: var(--pico-muted-color);
}

.location-card.no-coords {
    border-left: 3px solid var(--accent);
}

.unmapped-badge {
    display: inline-block;
    background: var(--accent);
    color: white;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    margin-top: 0.5rem;
}

/* Map container */
#map {
    width: 100%;
    height: 400px;
    border-radius: 12px;
    margin-bottom: 1rem;
}

#location-map {
    width: 100%;
    height: 250px;
    border-radius: 0;
}

.no-map {
    background: #f0f0f0;
    padding: 2.5rem;
    text-align: center;
    color: var(--pico-muted-color);
}

/* Fix Leaflet elements - remove Pico CSS styling conflicts */
#map img,
#location-map img,
.leaflet-container img,
.leaflet-pane img,
.leaflet-marker-icon,
.leaflet-marker-shadow {
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0;
}

.leaflet-marker-icon:focus,
.leaflet-interactive:focus {
    outline: none;
}

/* Fix Leaflet zoom controls - reset Pico CSS styling */
.leaflet-control-zoom {
    border: 2px solid rgba(0,0,0,0.2) !important;
    border-radius: 4px !important;
    background: none !important;
    box-shadow: none !important;
}

.leaflet-control-zoom a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 30px !important;
    height: 30px !important;
    line-height: 30px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-bottom: 1px solid #ccc !important;
    background-color: #fff !important;
    color: #333 !important;
    font-size: 18px !important;
    font-weight: bold !important;
    text-decoration: none !important;
    box-shadow: none !important;
}

.leaflet-control-zoom a:last-child {
    border-bottom: none !important;
}

.leaflet-control-zoom a:hover {
    background-color: #f4f4f4 !important;
}

/* Leaflet popup styling */
.leaflet-popup-content {
    margin: 12px 16px;
}

.popup-name {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--pico-primary);
    margin-bottom: 8px;
}

.popup-link {
    display: inline-block;
    background: var(--pico-primary);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
}

.popup-link:hover {
    background: var(--pico-primary-hover);
}

/* Tide window entries */
.window-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.window-entry {
    background: var(--pico-card-background-color);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    box-shadow: var(--pico-card-box-shadow);
}

.window-date {
    font-weight: 600;
    color: var(--pico-color);
    margin-bottom: 0.25rem;
}

.window-time {
    color: var(--pico-muted-color);
    font-size: 0.95rem;
}

.window-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.window-duration {
    color: var(--pico-primary);
    font-weight: 600;
}

.window-height {
    color: var(--pico-muted-color);
}

.window-light {
    color: #b8860b;
}

.window-weather {
    color: #2e7d32;
}

.window-weather a {
    color: inherit;
    text-decoration: none;
}

.window-weather a:hover {
    text-decoration: underline;
}

.window-noaa {
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.window-noaa a {
    color: var(--pico-primary);
}

/* Info sections for location detail */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.info-item {
    background: var(--pico-card-background-color);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: var(--pico-card-box-shadow);
}

.info-label {
    display: block;
    font-size: 0.85rem;
    color: var(--pico-muted-color);
    margin-bottom: 0.25rem;
}

.info-value {
    font-weight: 600;
    color: var(--pico-primary);
}

.difficulty-easy { color: #2e7d32; }
.difficulty-moderate { color: #f57c00; }
.difficulty-difficult { color: #c62828; }

.info-section {
    background: var(--pico-card-background-color);
    padding: 1.25rem;
    border-radius: 8px;
    box-shadow: var(--pico-card-box-shadow);
    margin-bottom: 1rem;
}

.info-section h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
}

.info-section ul {
    margin: 0;
    padding-left: 1.25rem;
}

.info-section li {
    margin-bottom: 0.5rem;
    color: #444;
}

/* Status/warning boxes */
.status-warning {
    background: #c62828;
    color: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.no-results {
    color: var(--pico-muted-color);
    font-style: italic;
    text-align: center;
    padding: 2rem;
}

.result-count {
    color: var(--pico-muted-color);
    margin-bottom: 0.5rem;
}

/* Form enhancements */
.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1rem;
}

.filter-row .form-group {
    flex: 1;
    min-width: 100px;
}

.toggle-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.toggle-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toggle-label {
    font-weight: 500;
    color: var(--pico-color);
}

.toggle-link {
    color: var(--pico-primary);
    text-decoration: none;
    font-size: 0.85rem;
}

.toggle-link:hover {
    text-decoration: underline;
}

/* Also known as */
.aka {
    font-style: italic;
    color: var(--text-on-primary);
    font-size: 0.9rem;
}

/* Sources */
.sources {
    color: var(--pico-muted-color);
    font-size: 0.85rem;
    margin-top: 1.5rem;
}

/* Page header with background */
.page-header {
    background: var(--pico-primary);
    color: white;
    padding: 1.5rem 0;
    margin: 0 -5% 1.5rem;
    padding-left: 5%;
    padding-right: 5%;
}

.page-header h1 {
    color: white;
    margin: 0;
    font-size: 1.75rem;
}

.page-header .subtitle {
    opacity: 0.9;
    margin: 0.25rem 0 0 0;
    font-size: 0.95rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .hero .tagline {
        font-size: 1.1rem;
    }

    .site-header nav ul {
        gap: 1rem;
    }

    .filter-row {
        flex-direction: column;
    }

    .filter-row .form-group {
        width: 100%;
    }

    .toggle-row {
        flex-direction: column;
        gap: 0.75rem;
    }

    #map {
        height: 300px;
    }

    .location-grid {
        grid-template-columns: 1fr;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .page-header {
        margin-left: -1rem;
        margin-right: -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Tide dashboard specific */
.tide-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.tide-card {
    background: var(--pico-card-background-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--pico-card-box-shadow);
}

.tide-card h2 {
    margin: 0 0 1rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--pico-primary);
    font-size: 1.25rem;
}

.tide-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.tide-column h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--pico-muted-color);
    margin-bottom: 1rem;
    font-family: var(--pico-font-family);
}

.tide-entry {
    background: #f9f9f9;
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

.tide-date {
    font-weight: 600;
    color: var(--pico-color);
}

.tide-time {
    font-size: 0.9rem;
    color: var(--pico-muted-color);
}

.tide-height {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--pico-primary);
    margin-top: 0.25rem;
}

.tide-twilight {
    font-size: 0.85rem;
    color: var(--pico-muted-color);
    margin-top: 0.25rem;
}

.twilight-label {
    display: inline-block;
    background: #ffd700;
    color: #333;
    font-size: 0.75rem;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    margin-right: 0.25rem;
}

.limited-msg {
    color: var(--pico-muted-color);
    font-size: 0.85rem;
    font-style: italic;
    margin-top: 0.5rem;
}

@media (max-width: 768px) {
    .tide-columns {
        grid-template-columns: 1fr;
    }

    .tide-cards {
        grid-template-columns: 1fr;
    }
}
