/* Main Style File - Page Specific Styles */
/* Maps, Profile, Admin, Auth, Review styles */

/* Animation Utils used in inline styles/scripts */
.pulse-icon {
    animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.33);
        opacity: 1;
    }

    80%,
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* Map View */
.map-fullscreen {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

#map {
    width: 100%;
    height: 100%;
    z-index: 10;
}

/* Filter UI */
.filter-container {
    position: absolute;
    top: 5rem;
    left: 1rem;
    right: 1rem;
    z-index: 1000;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.filter-toggle-btn {
    pointer-events: auto;
    background-color: white;
    color: var(--text-main);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
    font-weight: 700;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--border-color);
    transition: background-color 0.15s;
}

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

.filter-toggle-btn.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.filter-count {
    background-color: var(--primary);
    color: white;
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-full);
}

.filter-arrow {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: transform 0.2s;
    margin-left: 0.25rem;
}

.filter-list {
    display: block;
    pointer-events: auto;
    width: 100%;
    max-width: 24rem;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    padding: 0.75rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
    transform-origin: top left;
}

.filter-chips-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-chip {
    flex-shrink: 0;
    background-color: var(--bg-color);
    color: var(--text-muted);
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid transparent;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.filter-chip:hover {
    background-color: #e5e7eb;
}

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

/* Map Markers & Popups */
.marker-pin {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    background-color: #e5e7eb;
    position: relative;
    transition: transform 0.2s;
}

.marker-pin:hover {
    transform: scale(1.1);
}

.marker-pin img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.custom-popup .leaflet-popup-content-wrapper {
    border-radius: 0.75rem;
    padding: 0;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.custom-popup .leaflet-popup-content {
    margin: 0;
    width: auto !important;
}

/* Custom Close Button Override */
.leaflet-container a.leaflet-popup-close-button {
    top: -0.75rem !important;
    right: -0.75rem !important;
    width: 2.5rem !important;
    height: 2.5rem !important;
    background-color: white !important;
    border-radius: 50% !important;
    color: transparent !important;
    font-size: 0 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
    text-decoration: none !important;
    padding: 0 !important;
    opacity: 1 !important;
    border: 2px solid white !important;
    z-index: 1000;
    transition: all 0.2s ease !important;
}

.leaflet-container a.leaflet-popup-close-button::after {
    content: "\f00d";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: #374151;
    font-size: 1.125rem !important;
    line-height: 1;
    display: block;
}

.leaflet-container a.leaflet-popup-close-button:hover {
    background-color: #f3f4f6 !important;
    border-color: #e5e7eb !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
    transform: scale(1.1);
}

/* Locate Me Button */
.leaflet-control-custom a {
    background-color: white;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.65);
}

/* Detail & Other Scenes */
.popup-card {
    width: 12rem;
    font-family: 'Outfit', sans-serif;
    padding: 0.5rem;
}

.popup-image {
    aspect-ratio: 1 / 1;
    width: 100%;
    background-color: #e5e7eb;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 0.5rem;
    position: relative;
}

.popup-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
}

.popup-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.25rem;
}

.popup-tag {
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    background-color: var(--primary-light);
    color: var(--primary);
    border: 1px solid transparent;
    font-weight: 600;
}

.popup-title {
    font-weight: 700;
    color: var(--text-main);
    font-size: 1rem;
    margin-bottom: 0.125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.popup-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.popup-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background-color: var(--primary);
    color: white !important;
    font-weight: 700;
    padding: 0.625rem;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.2s;
}

.popup-btn:hover {
    background-color: var(--primary-hover);
    text-decoration: none;
}

/* Hero Section in Detail */
.hero-section {
    position: relative;
    height: 50vh;
    min-height: 24rem;
    color: white;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 2rem 1.5rem;
    color: white;
}

.hero-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    line-height: 1.1;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.back-btn-wrapper {
    position: absolute;
    top: 6rem;
    /* Below header */
    left: 1.5rem;
    z-index: 20;
}

.edit-btn-wrapper {
    position: absolute;
    top: 6rem;
    right: 1.5rem;
    z-index: 20;
}

.back-btn {
    width: 2.5rem;
    height: 2.5rem;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    box-shadow: var(--shadow-md);
    transition: transform 0.2s;
    font-size: 1rem;
}

.back-btn:hover {
    transform: scale(1.1);
    color: var(--primary);
}

.star-rating {
    display: flex;
    gap: 0.125rem;
    color: #facc15;
    font-size: 0.875rem;
}

.review-count {
    font-size: 0.875rem;
    opacity: 0.9;
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.hero-tag {
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-md);
    font-size: 0.625rem;
    font-weight: 700;
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.content-container {
    max-width: 48rem;
    margin: 0 auto;
    padding: 2rem 1.5rem 2rem;
    background-color: white;
    min-height: 50vh;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.user-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.user-text {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.user-name {
    color: var(--text-main);
    font-weight: 500;
}

.spot-description {
    color: #374151;
    line-height: 1.625;
    margin-bottom: 2rem;
}

.divider {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 2rem 0;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

/* Reviews */
.review-form-card {
    background-color: #f9fafb;
    border-radius: 1rem;
    padding: 1rem;
    margin-bottom: 2rem;
}

.rating-input {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.rating-star-icon {
    font-size: 1.5rem;
    color: #d1d5db;
    transition: color 0.15s;
    cursor: pointer;
}

.rating-star-icon:hover {
    color: #facc15;
}

.rating-star-icon.active {
    color: #facc15;
    font-weight: 900;
}

.review-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.review-item {
    display: flex;
    gap: 1rem;
}

.review-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background-color: #e5e7eb;
    color: var(--text-muted);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.review-content {
    flex-grow: 1;
}

.review-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.review-author {
    font-weight: 700;
    color: var(--text-main);
}

.review-date {
    font-size: 0.75rem;
    color: #9ca3af;
}

.review-stars {
    display: flex;
    font-size: 0.75rem;
    color: #facc15;
    margin-bottom: 0.5rem;
}

.review-text {
    font-size: 0.875rem;
    color: #4b5563;
    line-height: 1.5;
}

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

.login-prompt {
    background-color: #f9fafb;
    border-radius: 1rem;
    padding: 1rem;
    text-align: center;
    margin-bottom: 2rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.link-highlight {
    color: var(--primary);
    font-weight: 700;
}

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

/* Profile View */
.profile-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 3rem 0rem;
}

.profile-avatar {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background-color: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
}

.profile-info h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

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

.admin-badge {
    display: inline-flex;
    align-items: center;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    background-color: #111827;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: white;
    padding: 1rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 900;
    color: var(--text-main);
    margin-top: 0.25rem;
}

.chart-card {
    background-color: white;
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.chart-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.chart-wrapper {
    height: 12rem;
}

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

@media (min-width: 768px) {
    .spots-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.spot-card {
    background-color: white;
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.spot-card:hover {
    box-shadow: var(--shadow-md);
}

.spot-card-image {
    position: relative;
    aspect-ratio: 1 / 1;
    width: 100%;
    overflow: hidden;
}

.spot-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.spot-card:hover .spot-card-image img {
    transform: scale(1.05);
}

.spot-rating-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    border-radius: var(--radius-md);
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.spot-card-content {
    padding: 1rem;
}

.spot-card-title {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spot-card-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.spot-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    background-color: white;
    border-radius: 1rem;
    border: 2px dashed var(--border-color);
}

.empty-icon {
    font-size: 2.25rem;
    color: #9ca3af;
    margin-bottom: 1rem;
}

/* Profile Spot List Styles */
.profile-spots-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.profile-spot-item {
    display: flex;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1rem;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s;
}

.profile-spot-item:hover {
    box-shadow: var(--shadow-md);
}

.profile-spot-image {
    width: 5rem;
    height: 5rem;
    border-radius: 0.75rem;
    object-fit: cover;
    flex-shrink: 0;
}

.profile-spot-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.profile-spot-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-main);
}

.profile-spot-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.profile-spot-actions {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.btn-action-sm {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.2s;
    min-height: 2.5rem;
}

.btn-action-view {
    color: var(--primary);
    background-color: var(--primary-light);
}

.btn-action-view:hover {
    background-color: #c7d2fe;
}

.btn-action-delete {
    color: var(--danger);
    background-color: var(--danger-bg);
}

.btn-action-delete:hover {
    background-color: #fee2e2;
}


/* Admin View */
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 3rem 0rem;
}

.admin-header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-main);
}

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

.color-input-wrapper {
    width: 100%;
}

.color-input {
    width: 6rem;
    height: 3rem;
    padding: 0.25rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background-color: white;
    cursor: pointer;
    width: 100%;
    min-width: 5rem;
}

@media (min-width: 768px) {
    .tag-form {
        flex-direction: row;
        align-items: flex-end;
    }

    .color-input-wrapper {
        width: auto;
    }
}

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

@media (min-width: 768px) {
    .tag-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .tag-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.tag-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    background-color: #f9fafb;
}

.tag-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tag-color-preview {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
}

/* End of Page Specific Styles */
/* Map Cluster Icon */
.cluster-pin {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: white;
    border: 3px solid var(--primary);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    overflow: visible; /* Allow badge to show */
    position: relative;
    transition: transform 0.2s;
}

.cluster-pin:hover {
    transform: scale(1.1);
    z-index: 1000 !important;
}

.cluster-pin img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.cluster-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
