/* =========================================================
   Jelajah Kedah - Custom Styles
   Portal Pelancongan Rasmi Negeri Kedah Darul Aman
   ========================================================= */

/* ---------------------------------------------------------
   Map Overlay & Glass Effects
   --------------------------------------------------------- */
.map-overlay {
    position: absolute;
    z-index: 10;
    pointer-events: none;
}

.map-overlay-interactive {
    pointer-events: auto;
}

.map-glass {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.dark .map-glass {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(51, 65, 85, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.map-popup-glass {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.92);
    border-radius: 16px;
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.08),
        0 1px 2px rgba(0, 0, 0, 0.04);
}

.dark .map-popup-glass {
    background: rgba(30, 41, 59, 0.92);
}

.map-control-panel {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.dark .map-control-panel {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(51, 65, 85, 0.6);
}


/* ---------------------------------------------------------
   Card Hover Animations
   --------------------------------------------------------- */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.08),
        0 8px 16px rgba(0, 0, 0, 0.04);
}

.dark .card-hover:hover {
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.25),
        0 8px 16px rgba(0, 0, 0, 0.15);
}

.card-image-zoom {
    overflow: hidden;
}

.card-image-zoom img {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-image-zoom:hover img {
    transform: scale(1.08);
}

/* Destination card with overlay gradient */
.card-destination {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    transition: all 0.3s ease;
}

.card-destination::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
    z-index: 1;
    transition: height 0.3s ease;
}

.card-destination:hover::after {
    height: 70%;
}

.card-destination-content {
    position: relative;
    z-index: 2;
}

/* Interactive ripple effect on cards */
.card-ripple {
    position: relative;
    overflow: hidden;
}

.card-ripple::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(16, 185, 129, 0.08);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    z-index: 0;
}

.card-ripple:hover::before {
    width: 300%;
    height: 300%;
}


/* ---------------------------------------------------------
   Loading Skeleton Styles
   --------------------------------------------------------- */
.skeleton-text {
    height: 14px;
    border-radius: 6px;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

.dark .skeleton-text {
    background: linear-gradient(90deg, #334155 25%, #475569 50%, #334155 75%);
    background-size: 200% 100%;
}

.skeleton-heading {
    height: 20px;
    border-radius: 6px;
    width: 60%;
}

.skeleton-image {
    border-radius: 12px;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

.dark .skeleton-image {
    background: linear-gradient(90deg, #334155 25%, #475569 50%, #334155 75%);
    background-size: 200% 100%;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-card {
    border-radius: 16px;
    overflow: hidden;
}

.skeleton-card .skeleton-card-image {
    height: 200px;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

.skeleton-card .skeleton-card-body {
    padding: 16px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Shimmer effect variant */
.skeleton-shimmer {
    position: relative;
    overflow: hidden;
    background: #e2e8f0;
}

.dark .skeleton-shimmer {
    background: #334155;
}

.skeleton-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 1.5s ease-in-out infinite;
}

.dark .skeleton-shimmer::after {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}


/* ---------------------------------------------------------
   Hero Gradient Overlays
   --------------------------------------------------------- */
.hero-overlay {
    position: relative;
}

.hero-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
}

.hero-overlay-emerald::before {
    background: linear-gradient(
        135deg,
        rgba(5, 150, 105, 0.92) 0%,
        rgba(16, 185, 129, 0.75) 30%,
        rgba(14, 165, 233, 0.6) 60%,
        rgba(245, 158, 11, 0.4) 100%
    );
}

.hero-overlay-dark::before {
    background: linear-gradient(
        to top,
        rgba(15, 23, 42, 0.95) 0%,
        rgba(15, 23, 42, 0.6) 40%,
        rgba(15, 23, 42, 0.3) 70%,
        transparent 100%
    );
}

.hero-overlay-subtle::before {
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.4) 100%
    );
}

.hero-overlay-radial::before {
    background: radial-gradient(
        ellipse at 30% 50%,
        rgba(5, 150, 105, 0.85) 0%,
        rgba(14, 165, 233, 0.5) 50%,
        transparent 80%
    );
}

.hero-content {
    position: relative;
    z-index: 2;
}

/* Parallax-ready hero background */
.hero-bg {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: scroll;
}

@media (min-width: 1024px) {
    .hero-bg-parallax {
        background-attachment: fixed;
    }
}


/* ---------------------------------------------------------
   Smooth Page Transitions
   --------------------------------------------------------- */
.page-enter {
    animation: pageEnter 0.4s ease-out forwards;
}

@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-fade {
    animation: pageFade 0.3s ease-in-out forwards;
}

@keyframes pageFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Stagger animation for list items */
.stagger-enter > * {
    opacity: 0;
    transform: translateY(16px);
    animation: staggerItem 0.4s ease-out forwards;
}

.stagger-enter > *:nth-child(1)  { animation-delay: 0.05s; }
.stagger-enter > *:nth-child(2)  { animation-delay: 0.10s; }
.stagger-enter > *:nth-child(3)  { animation-delay: 0.15s; }
.stagger-enter > *:nth-child(4)  { animation-delay: 0.20s; }
.stagger-enter > *:nth-child(5)  { animation-delay: 0.25s; }
.stagger-enter > *:nth-child(6)  { animation-delay: 0.30s; }
.stagger-enter > *:nth-child(7)  { animation-delay: 0.35s; }
.stagger-enter > *:nth-child(8)  { animation-delay: 0.40s; }
.stagger-enter > *:nth-child(9)  { animation-delay: 0.45s; }
.stagger-enter > *:nth-child(10) { animation-delay: 0.50s; }
.stagger-enter > *:nth-child(11) { animation-delay: 0.55s; }
.stagger-enter > *:nth-child(12) { animation-delay: 0.60s; }

@keyframes staggerItem {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ---------------------------------------------------------
   Miscellaneous Utilities
   --------------------------------------------------------- */

/* Gradient text helper */
.text-gradient-primary {
    background: linear-gradient(135deg, #059669 0%, #10b981 50%, #34d399 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-hero {
    background: linear-gradient(135deg, #ffffff 0%, #d1fae5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Floating animation for decorative elements */
.float-animation {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-12px); }
}

/* Pulse dot for live/active indicators */
.pulse-dot {
    position: relative;
}

.pulse-dot::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse-ring 2s ease-in-out infinite;
}

@keyframes pulse-ring {
    0%   { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
    70%  { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Rating stars */
.star-rating {
    display: inline-flex;
    gap: 2px;
}

.star-rating .star {
    color: #e2e8f0;
}

.star-rating .star.filled {
    color: #fbbf24;
}

.star-rating .star.half {
    position: relative;
    color: #e2e8f0;
}

.star-rating .star.half::before {
    content: '\2605';
    position: absolute;
    left: 0;
    width: 50%;
    overflow: hidden;
    color: #fbbf24;
}

/* Badge / Tag styles */
.badge-category {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 9999px;
    transition: all 0.2s ease;
}

.badge-category-nature {
    background: #d1fae5;
    color: #065f46;
}

.badge-category-heritage {
    background: #fef3c7;
    color: #92400e;
}

.badge-category-beach {
    background: #e0f2fe;
    color: #075985;
}

.badge-category-food {
    background: #fce7f3;
    color: #9d174d;
}

.dark .badge-category-nature {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
}

.dark .badge-category-heritage {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
}

.dark .badge-category-beach {
    background: rgba(14, 165, 233, 0.15);
    color: #7dd3fc;
}

.dark .badge-category-food {
    background: rgba(236, 72, 153, 0.15);
    color: #f9a8d4;
}

/* Image aspect ratio containers */
.aspect-card  { aspect-ratio: 4 / 3; }
.aspect-hero  { aspect-ratio: 16 / 9; }
.aspect-thumb { aspect-ratio: 1 / 1; }

/* Prevent layout shift for images */
.img-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Safe area padding for mobile bottom nav */
.safe-bottom {
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Hide scrollbar but allow scrolling */
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

/* Horizontal scroll snap for carousels */
.scroll-snap-x {
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.scroll-snap-x > * {
    scroll-snap-align: start;
}

/* Focus visible outline for accessibility */
*:focus-visible {
    outline: 2px solid #10b981;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Print styles */
@media print {
    nav, footer, .mobile-nav, .back-to-top {
        display: none !important;
    }

    main {
        padding: 0 !important;
    }

    .no-print {
        display: none !important;
    }
}
