/* ===== Variables ===== */
:root {
    --primary-gradient: linear-gradient(135deg, #6366F1 0%, #EC4899 50%, #F59E0B 100%);
    --primary-color: #EC4899;
    --primary-dark: #DB2777;
    --secondary-color: #6366F1;
    --accent-color: #F59E0B;
    --accent-light: #FDE68A;
    --bg-color: #FAFAFA;
    --card-bg: #FFFFFF;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --border-color: #E5E7EB;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(99, 102, 241, 0.15);
    --shadow-lg: 0 8px 30px rgba(236, 72, 153, 0.2);
    --shadow-glow: 0 0 20px rgba(236, 72, 153, 0.3);
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 24px;
    --header-height: 60px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    overflow: hidden;
}

/* ===== Header ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--primary-gradient);
    border-radius: 50%;
    padding: 6px;
    color: white;
    box-shadow: var(--shadow-md);
    animation: logo-pulse 3s ease-in-out infinite;
}

@keyframes logo-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.btn-my-location {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-my-location:hover {
    background: var(--bg-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-my-location svg {
    width: 18px;
    height: 18px;
}

.btn-my-location span {
    display: none;
}

@media (min-width: 480px) {
    .btn-my-location span {
        display: inline;
    }
}

/* Explore Button */
.btn-explore {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-explore:hover {
    background: var(--bg-color);
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.btn-explore.active {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
}

.btn-explore svg {
    width: 18px;
    height: 18px;
}

.btn-explore span {
    display: none;
}

@media (min-width: 480px) {
    .btn-explore span {
        display: inline;
    }
}

/* Notifications Button */
.btn-notifications {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-notifications:hover {
    background: var(--bg-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-notifications svg {
    width: 20px;
    height: 20px;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--primary-color);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Notifications Panel */
.notifications-panel {
    position: fixed;
    top: var(--header-height);
    right: -350px;
    width: 350px;
    max-width: 90vw;
    height: calc(100vh - var(--header-height));
    background: var(--card-bg);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
}

.notifications-panel.open {
    right: 0;
}

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

.notifications-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.notifications-close {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: 50%;
    transition: all 0.2s;
}

.notifications-close:hover {
    background: var(--bg-color);
    color: var(--text-primary);
}

.notifications-close svg {
    width: 20px;
    height: 20px;
}

.notifications-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 20px;
    cursor: pointer;
    transition: background 0.2s;
    border-left: 3px solid transparent;
}

.notification-item:hover {
    background: var(--bg-color);
}

.notification-item.unread {
    background: rgba(236, 72, 153, 0.05);
    border-left-color: var(--primary-color);
}

.notification-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-text {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.4;
}

.notification-text strong {
    color: var(--primary-color);
}

.notification-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.no-notifications {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px 20px;
    font-size: 0.9rem;
}

.notifications-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
}

.btn-mark-all-read {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-mark-all-read:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ===== Map ===== */
#map {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

/* Custom Map Markers */
.custom-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--card-bg);
    border-radius: 50%;
    box-shadow: var(--shadow-md);
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 3px solid var(--card-bg);
    position: relative;
}

.custom-marker:hover {
    transform: scale(1.2);
    box-shadow: var(--shadow-lg);
    border-color: var(--secondary-color);
}

.custom-marker.active {
    border-color: var(--primary-color);
    transform: scale(1.25);
    box-shadow: var(--shadow-glow);
}

/* Markers with sightings - HIGHLIGHTED */
.custom-marker.has-sightings {
    border: 3px solid var(--primary-color);
    box-shadow: 0 0 0 4px rgba(225, 48, 108, 0.3), var(--shadow-lg);
    animation: pulse-marker 2s ease-in-out infinite;
    z-index: 100 !important;
}

.custom-marker.has-sightings:hover {
    animation: none;
    transform: scale(1.2);
    box-shadow: 0 0 0 6px rgba(225, 48, 108, 0.4), var(--shadow-lg);
}

/* Badge with sighting count */
.sighting-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    background: var(--primary-gradient);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Pulse animation for markers with sightings */
@keyframes pulse-marker {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(225, 48, 108, 0.3), var(--shadow-lg);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(225, 48, 108, 0.15), var(--shadow-lg);
    }
}

/* Hot marker - many sightings */
.custom-marker.hot {
    border-color: #F77737;
    box-shadow: 0 0 0 4px rgba(247, 119, 55, 0.4), var(--shadow-lg);
    animation: pulse-hot 1.5s ease-in-out infinite;
}

.custom-marker.hot .sighting-badge {
    background: linear-gradient(135deg, #F77737 0%, #E1306C 100%);
}

@keyframes pulse-hot {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(247, 119, 55, 0.4), var(--shadow-lg);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(247, 119, 55, 0.15), var(--shadow-lg);
    }
}

/* ===== Location Panel ===== */
.location-panel {
    position: fixed;
    top: var(--header-height);
    right: 0;
    width: 100%;
    max-width: 400px;
    height: calc(100% - var(--header-height));
    background: var(--card-bg);
    box-shadow: var(--shadow-lg);
    z-index: 500;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.location-panel.open {
    transform: translateX(0);
}

@media (max-width: 480px) {
    .location-panel {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: none;
        height: auto;
        max-height: 70vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        transform: translateY(100%);
    }

    .location-panel.open {
        transform: translateY(0);
    }
}

.panel-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.panel-close:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.panel-close svg {
    width: 18px;
    height: 18px;
}

.panel-header {
    display: flex;
    gap: 16px;
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
}

.place-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
    border-radius: var(--radius-md);
    font-size: 1.8rem;
    flex-shrink: 0;
}

.place-info {
    flex: 1;
    min-width: 0;
}

.place-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.place-type {
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 2px;
}

.place-address {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.panel-stats {
    display: flex;
    padding: 16px 20px;
    gap: 20px;
    border-bottom: 1px solid var(--border-color);
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Self-tag button in panel */
.btn-self-tag-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 16px 20px 8px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    border: none;
    border-radius: var(--radius-lg);
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-self-tag-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-self-tag-panel:hover::before {
    left: 100%;
}

.btn-self-tag-panel:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-self-tag-panel:active {
    transform: translateY(0) scale(0.98);
}

.btn-self-tag-panel svg {
    width: 20px;
    height: 20px;
}

.btn-report {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 20px 16px;
    padding: 12px 20px;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-report:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(236, 72, 153, 0.05);
}

.btn-report:active {
    transform: translateY(0) scale(0.98);
}

.btn-report svg {
    width: 20px;
    height: 20px;
}

.sightings-section {
    flex: 1;
    padding: 0 20px 20px;
}

.sightings-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 16px;
    padding-top: 8px;
}

.sightings-title svg {
    width: 18px;
    height: 18px;
}

.sightings-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.no-sightings {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 30px 20px;
    background: var(--bg-color);
    border-radius: var(--radius-md);
}

.sighting-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: var(--bg-color);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.sighting-item:hover {
    background: #f0f0f0;
}

.sighting-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    flex-shrink: 0;
}

.sighting-content {
    flex: 1;
    min-width: 0;
}

.sighting-username {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.sighting-username a {
    color: inherit;
    text-decoration: none;
}

.sighting-username a:hover {
    color: var(--primary-color);
}

.sighting-note {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.sighting-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95) translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.open .modal {
    transform: scale(1) translateY(0);
}

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

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

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

.modal-close:hover {
    background: var(--bg-color);
    color: var(--text-primary);
}

.modal-close svg {
    width: 18px;
    height: 18px;
}

.modal-body {
    padding: 20px;
}

.modal-location {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    padding: 10px 14px;
    background: var(--bg-color);
    border-radius: var(--radius-sm);
}

.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: border-color 0.2s ease;
}

.input-wrapper:focus-within {
    border-color: var(--primary-color);
}

.input-prefix {
    padding: 0 0 0 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.input-wrapper input {
    flex: 1;
    padding: 12px 14px 12px 4px;
    border: none;
    background: none;
    font-size: 1rem;
    color: var(--text-primary);
    outline: none;
}

.input-group textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-primary);
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.2s ease;
}

.input-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px 20px;
}

.btn-cancel {
    flex: 1;
    padding: 12px 20px;
    background: var(--bg-color);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.btn-submit {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 20px;
    background: var(--primary-gradient);
    border: none;
    border-radius: var(--radius-lg);
    font-size: 0.95rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-submit:hover::before {
    left: 100%;
}

.btn-submit:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--shadow-glow);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-submit:disabled::before {
    display: none;
}

.btn-submit svg {
    width: 18px;
    height: 18px;
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: var(--text-primary);
    color: white;
    border-radius: 30px;
    box-shadow: var(--shadow-lg);
    z-index: 3000;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-icon {
    width: 20px;
    height: 20px;
    color: #4ade80;
}

.toast-message {
    font-size: 0.95rem;
    font-weight: 500;
}

/* ===== Loading State ===== */
.loading-map {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    z-index: 100;
}

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

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== Leaflet Overrides ===== */
.leaflet-control-zoom {
    border: none !important;
    box-shadow: var(--shadow-md) !important;
}

.leaflet-control-zoom a {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
    border: none !important;
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
    font-size: 18px !important;
}

.leaflet-control-zoom a:first-child {
    border-radius: var(--radius-sm) var(--radius-sm) 0 0 !important;
}

.leaflet-control-zoom a:last-child {
    border-radius: 0 0 var(--radius-sm) var(--radius-sm) !important;
}

.leaflet-control-zoom a:hover {
    background: var(--bg-color) !important;
}

.leaflet-popup-content-wrapper {
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-md) !important;
    padding: 0 !important;
}

.leaflet-popup-content {
    margin: 0 !important;
    min-width: 200px;
}

.leaflet-popup-tip {
    box-shadow: var(--shadow-sm) !important;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ===== Search Bar ===== */
.search-container {
    position: relative;
    flex: 1;
    max-width: 400px;
    margin: 0 16px;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 10px 14px 10px 42px;
    background: var(--bg-color);
    border: 2px solid transparent;
    border-radius: 24px;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--card-bg);
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 1001;
}

.search-results.open {
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.search-result-item:hover {
    background: var(--bg-color);
}

.search-result-item:first-child {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.search-result-item:last-child {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.search-result-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
    border-radius: 50%;
    font-size: 1rem;
}

.search-result-info h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.search-result-info p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.search-result-tag {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 8px;
    background: var(--primary-gradient);
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 10px;
    text-transform: uppercase;
}

.search-no-results {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== Header Actions ===== */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== Filter Dropdown ===== */
.filter-dropdown {
    position: relative;
}

.btn-filter {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-filter:hover {
    background: var(--bg-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

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

.btn-filter svg {
    width: 16px;
    height: 16px;
}

.btn-filter span {
    display: none;
}

@media (min-width: 600px) {
    .btn-filter span {
        display: inline;
    }
}

.filter-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 220px;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 8px 0;
    display: none;
    z-index: 1001;
}

.filter-menu.open {
    display: block;
}

.filter-header {
    padding: 10px 16px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s ease;
}

.filter-option:hover {
    background: var(--bg-color);
}

.filter-option input[type="checkbox"] {
    display: none;
}

.filter-option .checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.filter-option input[type="checkbox"]:checked + .checkmark {
    background: var(--primary-gradient);
    border-color: transparent;
}

.filter-option input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* ===== Login & Profile Buttons ===== */
.btn-login {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: var(--primary-gradient);
    border: none;
    border-radius: var(--radius-lg);
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.btn-login:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow-glow);
}

.btn-login svg {
    width: 18px;
    height: 18px;
}

.btn-login span {
    display: none;
}

@media (min-width: 600px) {
    .btn-login span {
        display: inline;
    }
}

.btn-profile {
    width: 40px;
    height: 40px;
    padding: 0;
    background: none;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s ease;
}

.btn-profile:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(225, 48, 108, 0.3);
}

.profile-avatar {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
}

/* ===== Auth Modal ===== */
.auth-modal {
    max-width: 380px;
}

.auth-logo {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    border-radius: 50%;
}

.auth-logo svg {
    width: 32px;
    height: 32px;
    color: white;
}

.auth-modal .input-group input {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    color: var(--text-primary);
    transition: border-color 0.2s ease;
}

.auth-modal .input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-full {
    width: 100%;
    margin-top: 8px;
}

.auth-switch {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 16px;
}

.auth-switch a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* ===== Profile Picture Upload ===== */
.profile-picture-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.profile-picture-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 3px solid var(--border-color);
    transition: border-color 0.3s ease;
}

.profile-picture-preview:hover {
    border-color: var(--primary-color);
}

.profile-picture-preview svg {
    width: 50px;
    height: 50px;
    color: #aaa;
}

.profile-picture-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-picture-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.profile-picture-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.profile-picture-btn svg {
    width: 16px;
    height: 16px;
}

/* ===== Self Tag Button ===== */
.btn-self-tag {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-self-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-self-tag svg {
    width: 20px;
    height: 20px;
}

/* ===== Profile Modal ===== */
.profile-modal {
    max-width: 400px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.profile-avatar-large {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.5rem;
    overflow: hidden;
}

.profile-avatar-wrapper {
    position: relative;
}

.profile-picture-change {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 28px;
    height: 28px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid white;
    transition: transform 0.2s ease;
}

.profile-picture-change:hover {
    transform: scale(1.1);
}

.profile-picture-change svg {
    width: 14px;
    height: 14px;
    color: white;
}

.profile-info h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.profile-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.profile-stats {
    display: flex;
    gap: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.profile-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.profile-stat .stat-number {
    font-size: 1.3rem;
    font-weight: 700;
}

.profile-stat .stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.profile-section h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.profile-activity {
    max-height: 200px;
    overflow-y: auto;
}

.no-activity {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    background: var(--bg-color);
    border-radius: var(--radius-sm);
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--bg-color);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.activity-item:last-child {
    margin-bottom: 0;
}

.activity-icon {
    font-size: 1.2rem;
}

.activity-content {
    flex: 1;
}

.activity-content strong {
    font-weight: 600;
}

.activity-content p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    color: #ef4444;
}

.btn-logout:hover {
    background: #fef2f2;
    color: #dc2626;
}

.btn-logout svg {
    width: 18px;
    height: 18px;
}

/* ===== Welcome Modal ===== */
.welcome-modal {
    max-width: 420px;
    text-align: center;
}

.welcome-header {
    padding: 30px 20px 20px;
    border-bottom: 1px solid var(--border-color);
}

.welcome-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(236, 72, 153, 0.5);
    animation: heartbeat-glow 1.5s ease-in-out infinite;
}

@keyframes heartbeat-glow {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(236, 72, 153, 0.6);
    }
    15% {
        transform: scale(1.15);
        box-shadow: 0 0 20px 10px rgba(236, 72, 153, 0.4);
    }
    30% {
        transform: scale(1);
        box-shadow: 0 0 10px 5px rgba(236, 72, 153, 0.3);
    }
    45% {
        transform: scale(1.1);
        box-shadow: 0 0 15px 8px rgba(236, 72, 153, 0.35);
    }
    60%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(236, 72, 153, 0.1);
    }
}

.welcome-logo svg {
    width: 40px;
    height: 40px;
    color: white;
    animation: pin-pulse 1.5s ease-in-out infinite;
}

@keyframes pin-pulse {
    0%, 60%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    15% {
        transform: scale(1.1);
        opacity: 1;
    }
    30% {
        transform: scale(1);
        opacity: 0.9;
    }
    45% {
        transform: scale(1.05);
        opacity: 1;
    }
}

.welcome-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 6px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.welcome-steps {
    padding: 20px;
}

.welcome-step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    text-align: left;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.welcome-step:last-child {
    border-bottom: none;
}

.step-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-color) 0%, var(--border-color) 100%);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.step-content h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 2px;
    color: var(--text-primary);
}

.step-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.welcome-footer {
    padding: 16px 20px 24px;
}

.welcome-footer .btn-submit {
    gap: 8px;
}

.welcome-footer .btn-submit svg {
    width: 18px;
    height: 18px;
}

/* ===== Mobile Adjustments ===== */
@media (max-width: 600px) {
    .header {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 12px;
        gap: 10px;
    }

    .search-container {
        order: 3;
        flex: 0 0 100%;
        max-width: none;
        margin: 0;
    }

    .search-input {
        padding: 12px 14px 12px 42px;
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    .search-results {
        max-height: 250px;
    }

    .header-actions {
        gap: 6px;
    }

    .btn-my-location {
        width: 40px;
        height: 40px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }

    .btn-my-location svg {
        margin: 0;
    }

    #map {
        top: 110px; /* Adjust for taller header with search */
    }

    .location-panel {
        max-height: 60vh;
    }
}

@media (max-width: 480px) {
    .logo-text {
        display: none;
    }

    .header {
        padding: 8px 10px;
    }

    .search-input {
        padding: 10px 12px 10px 38px;
    }

    #map {
        top: 100px;
    }
}

/* ===== Crop Modal ===== */
.crop-modal {
    max-width: 400px;
    width: 90%;
}

.crop-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.crop-area {
    position: relative;
    width: 280px;
    height: 280px;
    overflow: hidden;
    border-radius: 50%;
    background: #1a1a1a;
    cursor: grab;
    touch-action: none;
}

.crop-area:active {
    cursor: grabbing;
}

.crop-area img {
    position: absolute;
    max-width: none;
    transform-origin: center center;
    user-select: none;
    -webkit-user-drag: none;
}

.crop-overlay {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.crop-circle {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid white;
    pointer-events: none;
    box-shadow: var(--shadow-glow);
}

.crop-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 0 20px 10px;
}

.crop-zoom-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.crop-zoom-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: var(--border-color);
    outline: none;
}

.crop-zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-gradient);
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s;
}

.crop-zoom-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.crop-zoom-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-gradient);
    cursor: pointer;
    border: none;
    box-shadow: var(--shadow-md);
}

@media (max-width: 480px) {
    .crop-modal {
        max-width: 95%;
    }

    .crop-area {
        width: 240px;
        height: 240px;
    }
}
