:root {
    /* Modern color palette */
    --primary: #2196F3;      /* A vibrant blue */
    --primary-dark: #1976D2;
    --secondary: #FF4081;    /* Pink accent for important actions */
    --background: #F5F7FA;   /* Light gray background */
    --surface: #FFFFFF;      /* White surface color */
    --text: #2C3E50;        /* Dark blue text */
    --text-light: #647687;   /* Lighter text for secondary content */
    --success: #4CAF50;      /* Green for positive actions */
    --error: #F44336;       /* Red for errors/warnings */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--background);
    color: var(--text);
    margin: 0;
    font-family: 'Inter', sans-serif;
}

/* Allow scrolling on admin and spots list pages */
body.admin-page,
body.spots-list-page {
    overflow: auto;
    height: auto;
    display: block;
}

/* Header styles */
.main-header {
    background: var(--surface);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1000;
}

nav {
    padding: 0;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.nav-link {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.nav-link:hover {
    color: var(--primary);
    background: rgba(33, 150, 243, 0.1);
}

/* Main content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Footer styles */
.main-footer {
    background: var(--surface);
    padding: 0.75rem 0;
    margin-top: auto;
    border-top: 1px solid var(--surface-light);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-light);
}

.footer-links {
    display: flex;
    gap: 1rem;
}

.footer-link {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-link:hover {
    color: var(--primary);
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

/* Map page specific */
.map-page {
    overflow: hidden;
}

.map-page .main-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    height: calc(100vh - 120px); /* Adjust for header and footer */
}

.map-sidebar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.map-container {
    height: 100%;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .map-page .main-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .map-sidebar {
        padding: 1rem;
        text-align: center;
    }

    .nav-links {
        gap: 1rem;
    }
}

main {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    overflow: hidden;  /* Only for main map page */
}

.admin-page main,
.spots-list-page main {
    display: block;
    overflow: auto;
}

.hero {
    padding: 1.5rem;
    min-height: auto;
    text-align: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1rem;
    text-align: center;
}

.hero-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

#surfMap {
    height: 100%;
    width: 100%;
}

.spots-list {
    padding: 2rem;
}

.spots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
}

.form-container {
    max-width: 800px;
    margin: 1rem auto;
    padding: 1.5rem;
    background: var(--surface);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.spot-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.form-group label {
    font-weight: bold;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.form-group textarea {
    height: 80px;
    resize: vertical;
}

.disciplines-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
}

.discipline-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.submit-btn {
    background-color: #3498db;
    color: white;
    padding: 0.75rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

.submit-btn:hover {
    background-color: #2980b9;
}

.add-spot-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: white;
    color: var(--primary);
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s;
}

.info-icon {
    font-size: 0.9rem;
    opacity: 0.8;
    cursor: help;
}

/* Tooltip styles */
[title] {
    position: relative;
}

[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 0.875rem;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    margin-bottom: 5px;
}

[title]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.8);
    margin-bottom: -5px;
}

.spot-card {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.spot-card:hover {
    transform: translateY(-2px);
}

.spot-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.spot-buddies {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.spot-buddies .buddy-count {
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 1;
}

.buddy-label {
    font-size: 0.75rem;
    opacity: 0.9;
}

.spot-description {
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.spot-details {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: auto;
}

.view-on-map-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--background);
    color: var(--primary);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.view-on-map-btn:hover {
    background: var(--primary);
    color: white;
}

.disciplines {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.discipline-tag {
    background-color: #3498db;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.875rem;
}

.spot-picker-map {
    height: 250px;
    width: 100%;
    margin: 0.5rem 0;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.coordinates-text {
    margin-top: 0.5rem;
    color: #666;
    font-size: 0.9rem;
}

button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.spot-popup {
    max-width: 220px;
    font-size: 0.9rem;
}

.spot-popup h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    color: var(--text);
}

.spot-popup p {
    margin: 0.25rem 0;
    color: var(--text-light);
    font-size: 0.85rem;
    line-height: 1.3;
}

.spot-popup .spot-disciplines {
    margin: 0.5rem 0;
}

.spot-popup .discipline-tag {
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
}

.spot-popup .buddy-info {
    margin: 0.5rem 0;
    gap: 0.5rem;
}

.spot-popup .buddy-count-display {
    font-size: 0.8rem;
}

.spot-popup .checkin-btn {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

.spot-popup .tide-info {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    font-size: 0.8rem;
}

.spot-popup .tide-info h4 {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.spot-popup .current-tide,
.spot-popup .station-name,
.spot-popup .tide-extreme {
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.leaflet-popup-content-wrapper {
    border-radius: 8px;
}

.leaflet-popup-content {
    margin: 1rem;
    font-size: 16px;
}

.leaflet-container a.leaflet-popup-close-button {
    width: 30px;
    height: 30px;
    padding: 8px;
    font-size: 20px;
}

.tide-info {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.tide-info h4 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.current-tide {
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.tide-extreme {
    font-size: 0.9rem;
    padding: 0.25rem 0;
}

.tide-extreme.high {
    color: #e74c3c;
}

.tide-extreme.low {
    color: #3498db;
}

.station-name {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.5rem;
    font-style: italic;
}

.spot-marker {
    position: relative;
}

/* Spot marker styles */
.marker-pin {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: white;
    position: absolute;
    left: 50%;
    top: 50%;
    margin: -15px 0 0 -15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    border: 2px solid var(--primary);
}

/* Surfboard inside the pin */
.marker-pin::after {
    content: '';
    display: block;
    width: 12px;
    height: 20px;
    background: var(--primary);
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    border-radius: 40% 40% 60% 60%;
}

.buddy-info {
    margin: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
}

.checkin-btn {
    width: 100%;
    padding: 0.5rem;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s;
}

.checkin-btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.checkin-btn:disabled {
    background: var(--text-light);
    cursor: not-allowed;
}

.buddy-count-display {
    font-size: 0.9rem;
    color: #666;
}

/* Map styling */
.leaflet-tile-pane {
    filter: saturate(1.1) hue-rotate(5deg) brightness(1.05);  /* Subtle water enhancement */
}

/* Hide most map details */
.leaflet-control-attribution {
    font-size: 7px !important;
    opacity: 0.5;
}

/* Clean map controls */
.leaflet-control-zoom {
    margin: 15px !important;
    opacity: 0.8;
}

/* Remove grid lines and labels */
.leaflet-grid-label {
    display: none !important;
}

/* Spots list page specific styles */
.spots-list-page {
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.spots-list-page h1 {
    margin-bottom: 2rem;
    color: var(--text);
}

/* Show footer on spots list page */
.spots-list-page + footer {
    display: block;
}

/* Style for spots list button */
.spots-list-btn {
    display: inline-block;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    margin-left: 1rem;
    transition: background-color 0.2s;
}

.spots-list-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Desktop styles */
@media (min-width: 768px) {
    body {
        grid-template-columns: 350px 1fr;
    }

    main {
        grid-template-columns: 350px 1fr;
        grid-template-rows: 1fr;
    }

    .hero {
        padding: 2rem;
        text-align: left;
        min-height: 100%;
    }

    .hero h1 {
        font-size: 2.8rem;
    }

    .hero p {
        text-align: left;
        font-size: 1.25rem;
    }

    .hero-actions {
        flex-direction: row;
        justify-content: flex-start;
    }

    .buddy-info {
        flex-direction: row;
        align-items: center;
    }

    .checkin-btn {
        width: auto;
        padding: 0.75rem 1.5rem;
    }

    .admin-header {
        flex-direction: row;
    }
    
    .admin-dashboard {
        padding: 2rem;
    }

    .spots-grid {
        padding: 2rem;
    }

    .spot-picker-map {
        height: 300px;
    }

    .form-container {
        margin: 2rem auto;
        padding: 2rem;
    }
}

/* Spots list page responsive styling */
@media (min-width: 768px) {
    .spots-list-page {
        padding: 6rem 2rem 2rem;
    }
}

/* Make map controls more touch-friendly */
.leaflet-touch .leaflet-control-zoom a {
    width: 44px;
    height: 44px;
    line-height: 44px;
    font-size: 22px;
}

/* Adjust popup for touch */
.leaflet-popup-content {
    margin: 1rem;
    font-size: 16px;
}

.leaflet-container a.leaflet-popup-close-button {
    width: 30px;
    height: 30px;
    padding: 8px;
    font-size: 20px;
}

/* Admin styles */
.admin-login {
    max-width: 400px;
    margin: 4rem auto;
    padding: 2rem;
    background: var(--surface);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.admin-dashboard {
    padding: 1rem;
    overflow-x: auto;  /* Allow horizontal scroll for table */
    max-width: 1200px;
    margin: 0 auto;
}

.admin-header {
    flex-direction: column;
    gap: 1rem;
}

.admin-actions {
    flex-wrap: wrap;
}

.spots-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: var(--surface);
    border-radius: 8px;
    overflow: hidden;
    min-width: 800px;  /* Ensure table doesn't get too squished */
}

.spots-table th,
.spots-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--background);
}

.spots-table th {
    background: var(--primary);
    color: white;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    background: var(--primary);
    color: white;
}

.btn-warning {
    background: #ff9800;
}

.btn-danger {
    background: var(--error);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Make sure forms are scrollable on mobile */
.admin-page .form-container,
.spots-list-page .form-container {
    margin: 1rem auto;
    padding: 1rem;
}

@media (min-width: 768px) {
    .admin-page .form-container,
    .spots-list-page .form-container {
        margin: 2rem auto;
        padding: 2rem;
    }
}

/* Buddy count badge */
.marker-buddy-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--secondary);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn-success {
    background: var(--success);
}

.no-applications {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
}

.applications-list {
    margin-top: 2rem;
}

.form-info {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    font-size: 0.9rem;
}

/* New spot form specific styles */
.spot-form-page {
    min-height: 100vh;
    background: var(--background);
    padding: 1rem;
}

.spot-form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1.5rem;
    background: var(--surface);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.spot-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.form-group {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    color: var(--text);
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.form-group textarea {
    height: 80px;
    resize: vertical;
}

.spot-picker-map {
    height: 250px;
    border-radius: 4px;
    margin: 0.25rem 0;
}

.disciplines-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.discipline-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.coordinates-text {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.submit-btn {
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    width: 100%;
    margin-top: 0.5rem;
}

.submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Desktop adjustments */
@media (min-width: 768px) {
    .spot-form-page {
        padding: 2rem;
    }

    .spot-form {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .map-section,
    .disciplines-section,
    .submit-section {
        grid-column: 1 / -1;
    }
}

/* New spot marker styling */
.new-spot-marker .marker-pin {
    border-color: var(--secondary);
}

.new-spot-marker .marker-pin::after {
    background: var(--secondary);
} 