/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #fafbfc;
    color: #1a202c;
    overflow: hidden;
}

/* CSS Variables */
:root {
    --primary-blue: #3b82f6;
    --primary-blue-dark: #2563eb;
    --secondary-teal: #06b6d4;
    --success-green: #10b981;
    --warning-orange: #f59e0b;
    --danger-red: #ef4444;
    
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

/* Navigation */
/* Header */
.app-header {
    background: linear-gradient(135deg, #1e40af 0%, #0891b2 100%);
    color: white;
    padding: 16px 24px;
    text-align: center;
    position: relative;
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 6px;
}

.logo i {
    font-size: 24px;
    color: rgba(255, 255, 255, 0.9);
}

.brand-text {
    font-size: 24px;
    font-weight: 700;
    color: white;
}

.header-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 300;
}

/* Floating Action Buttons */
.floating-actions {
    position: absolute;
    top: 16px;
    right: 20px;
    display: flex;
    gap: 8px;
}

.floating-btn {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.floating-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px) scale(1.05);
}

/* App Layout */
.app-layout {
    display: flex;
    height: calc(100vh - 80px);
}

/* Map Container */
.map-container {
    flex: 1;
    position: relative;
    background: var(--gray-100);
}

.map-controls {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.search-section {
    display: flex;
    justify-content: center;
}

.search-input {
    position: relative;
    width: 100%;
    max-width: 500px;
}

.search-input i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    z-index: 2;
}

.search-input input {
    width: 100%;
    height: 48px;
    padding: 0 50px 0 48px;
    border: none;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg);
    font-size: 16px;
    color: var(--gray-700);
    outline: none;
    transition: all 0.2s ease;
}

.search-input input:focus {
    box-shadow: var(--shadow-xl), 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-input input::placeholder {
    color: var(--gray-400);
}

.clear-search {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    border-radius: 50%;
    color: var(--gray-400);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-search:hover {
    background: var(--gray-200);
    color: var(--gray-600);
}

.filter-section {
    display: flex;
    justify-content: center;
}

.filter-group {
    display: flex;
    gap: 12px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 12px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border: 2px solid transparent;
    border-radius: var(--radius);
    background: var(--gray-100);
    color: var(--gray-600);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.filter-btn:hover {
    background: var(--gray-200);
}

.filter-btn.active {
    background: white;
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    box-shadow: var(--shadow);
}

.filter-btn .count {
    background: var(--gray-300);
    color: var(--gray-700);
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.filter-btn.active .count {
    background: var(--primary-blue);
    color: white;
}

/* Map */
.map {
    width: 100%;
    height: 100%;
    border-radius: 0;
}

.map-legend {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
}

.legend-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 12px;
    font-size: 14px;
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--gray-600);
}

.legend-item i.swimming {
    color: #1e40af;
}

.legend-item i.natural {
    color: #047857;
}

.legend-item i.lagoon {
    color: #0369a1;
}

/* Loading */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top: 3px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-spinner span {
    color: var(--gray-600);
    font-weight: 500;
}

/* Right Panel */
.right-panel {
    width: 360px;
    background: white;
    border-left: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* Advertisement */
.ad-container {
    border-bottom: 1px solid var(--gray-200);
}

.ad-header {
    padding: 16px 20px 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ad-content {
    padding: 0 20px 20px;
}

.ad-main {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius-lg);
    padding: 20px;
    color: white;
    position: relative;
    overflow: hidden;
}

.ad-main::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(30px, -30px);
}

.ad-image {
    text-align: center;
    margin-bottom: 16px;
}

.ad-image i {
    font-size: 32px;
    opacity: 0.9;
}

.ad-text h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.ad-text p {
    font-size: 14px;
    opacity: 0.9;
    line-height: 1.5;
    margin-bottom: 16px;
}

.ad-button {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ad-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.ad-secondary {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ad-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ad-item:hover {
    background: var(--gray-100);
}

.ad-item i {
    color: var(--primary-blue);
    font-size: 16px;
}

.ad-item div {
    display: flex;
    flex-direction: column;
}

.ad-item strong {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
}

.ad-item span {
    font-size: 12px;
    color: var(--gray-500);
}

/* Pool Details */
.pool-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid var(--gray-200);
}

.details-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--gray-200);
}

.details-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-800);
}

.close-details {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--gray-100);
    border-radius: 50%;
    color: var(--gray-500);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-details:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

.details-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-state i {
    font-size: 48px;
    color: var(--gray-300);
    margin-bottom: 16px;
}

.empty-state h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: var(--gray-500);
    line-height: 1.5;
}

/* Pool Details Content */
.pool-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.pool-image {
    margin-bottom: 20px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.pool-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.pool-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.pool-type {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: var(--gray-100);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: var(--gray-600);
}

.favorite-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--gray-100);
    border-radius: 50%;
    color: var(--gray-400);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.favorite-btn:hover {
    background: var(--gray-200);
}

.favorite-btn.active {
    background: var(--danger-red);
    color: white;
}

.detail-item {
    margin-bottom: 20px;
}

.detail-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.detail-value {
    font-size: 14px;
    color: var(--gray-700);
    line-height: 1.6;
}

.detail-value.hours {
    white-space: pre-line;
    font-family: inherit;
    font-size: 14px;
}

.website-link {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
}

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

.pool-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
}

.action-btn {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--gray-300);
    background: white;
    border-radius: var(--radius);
    color: var(--gray-700);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.action-btn:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.action-btn.primary {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: white;
}

.action-btn.primary:hover {
    background: var(--primary-blue-dark);
    border-color: var(--primary-blue-dark);
}

/* Information Section */
.info-section {
    border-bottom: 1px solid var(--gray-200);
    padding: 0;
}

.info-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.info-header h3 {
    color: var(--gray-800);
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-header i {
    color: var(--primary-blue);
}

/* Information Cards */
.info-card {
    margin: 16px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card-header {
    padding: 16px 20px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
}

.safety-card .card-header {
    background: #fef2f2;
    border-bottom-color: #fecaca;
}

.safety-card .card-header i {
    color: var(--danger-red);
}

.about-card .card-header i {
    color: var(--primary-blue);
}

.card-content {
    padding: 20px;
}

/* Safety Alerts */
.safety-alerts {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.alert {
    padding: 12px;
    border-radius: var(--radius);
    background: var(--gray-50);
    border-left: 3px solid var(--warning-orange);
    font-size: 13px;
    line-height: 1.4;
}

.alert.critical {
    background: #fef2f2;
    border-left-color: var(--danger-red);
}

.alert strong {
    color: var(--gray-800);
    font-weight: 600;
}

/* About Highlights */
.about-highlights {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.highlight {
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--radius);
    font-size: 13px;
    line-height: 1.4;
    border-left: 3px solid var(--primary-blue);
}

.highlight strong {
    color: var(--gray-800);
    font-weight: 600;
}

/* Tips Grid */
.tips-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.tip {
    padding: 10px 12px;
    background: var(--secondary-teal);
    color: white;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 500;
    text-align: center;
}

/* Favorites Section */
.favorites-section {
    border-bottom: 1px solid var(--gray-200);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--gray-200);
}

.section-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
}

.clear-favorites {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--gray-100);
    border-radius: 50%;
    color: var(--gray-500);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-favorites:hover {
    background: var(--danger-red);
    color: white;
}

.favorites-list {
    max-height: 300px;
    overflow-y: auto;
}

.empty-favorites {
    text-align: center;
    padding: 40px 20px;
}

.empty-favorites i {
    font-size: 32px;
    color: var(--gray-300);
    margin-bottom: 12px;
}

.empty-favorites p {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-600);
    margin-bottom: 4px;
}

.empty-favorites span {
    font-size: 12px;
    color: var(--gray-500);
}

.favorite-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    transition: all 0.2s ease;
}

.favorite-item:hover {
    background: var(--gray-50);
}

.favorite-item:last-child {
    border-bottom: none;
}

.favorite-info {
    flex: 1;
}

.favorite-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.favorite-type {
    font-size: 12px;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 6px;
}

.remove-favorite {
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    color: var(--gray-400);
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-favorite:hover {
    background: var(--danger-red);
    color: white;
}

/* Notifications */
.notification {
    position: fixed;
    top: 90px;
    right: 20px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 2000;
}

.notification.show {
    transform: translateX(0);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--gray-200);
    min-width: 300px;
}

.notification.success .notification-content {
    border-left: 4px solid var(--success-green);
}

.notification.error .notification-content {
    border-left: 4px solid var(--danger-red);
}

.notification.info .notification-content {
    border-left: 4px solid var(--primary-blue);
}

.notification-icon {
    font-size: 18px;
}

.notification.success .notification-icon {
    color: var(--success-green);
}

.notification.error .notification-icon {
    color: var(--danger-red);
}

.notification.info .notification-icon {
    color: var(--primary-blue);
}

.notification-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
}

/* Custom Leaflet Styling */
.leaflet-popup-content-wrapper {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--gray-200);
}

.leaflet-popup-tip {
    border: 1px solid var(--gray-200);
}

.popup-content {
    padding: 4px 0;
}

.popup-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.popup-type {
    font-size: 12px;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 6px;
}

.popup-hint {
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 8px;
    font-style: italic;
}

/* Map Markers */
.custom-marker {
    background: none !important;
    border: none !important;
}

.marker-background {
    width: 40px;
    height: 40px;
    background: white;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    cursor: pointer;
}

.marker-background:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.marker-background i {
    font-size: 18px;
    font-weight: 900;
}

.marker-swimming .marker-background {
    border-color: #1e40af;
    background: linear-gradient(135deg, white 0%, #dbeafe 100%);
}

.marker-natural .marker-background {
    border-color: #f59e0b;
    background: linear-gradient(135deg, white 0%, #fef3c7 100%);
}

.marker-lagoon .marker-background {
    border-color: #7c3aed;
    background: linear-gradient(135deg, white 0%, #e9d5ff 100%);
}

/* Cluster Styling */
.marker-cluster {
    background: rgba(59, 130, 246, 0.1);
    border: 2px solid var(--primary-blue);
    transition: all 0.2s ease;
    cursor: pointer;
}

.marker-cluster:hover {
    transform: scale(1.1);
    background: rgba(59, 130, 246, 0.2);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.marker-cluster div {
    background: var(--primary-blue);
    color: white;
    font-weight: 600;
}

/* Reset to Original View Button */
.reset-view-btn {
    position: absolute;
    bottom: 80px;
    right: 20px;
    z-index: 1000;
    padding: 8px 12px;
    background: white;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    color: var(--gray-700);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    display: none;
}

.reset-view-btn:hover {
    background: var(--gray-50);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.reset-view-btn.show {
    display: block;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .right-panel {
        width: 320px;
    }
    
    .filter-group {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .map-controls {
        left: 10px;
        right: 10px;
    }
}

@media (max-width: 768px) {
    .nav {
        padding: 0 16px;
    }
    
    .nav-menu {
        gap: 4px;
    }
    
    .nav-item span {
        display: none;
    }
    
    .app-layout {
        flex-direction: column;
    }
    
    .right-panel {
        width: 100%;
        height: 50vh;
        border-left: none;
        border-top: 1px solid var(--gray-200);
    }
    
    .map-container {
        height: 50vh;
    }
    
    .map-controls {
        position: relative;
        top: 10px;
        left: 10px;
        right: 10px;
        margin-bottom: 10px;
    }
    
    .search-input input {
        height: 44px;
        font-size: 16px;
    }
    
    .filter-btn span {
        display: none;
    }
    
    .map-legend {
        bottom: 10px;
        left: 10px;
        right: 10px;
    }
    
    .legend-items {
        flex-direction: row;
        justify-content: space-between;
    }
}