/* Places to Discover Page Styles - Complete Updated Version */

/* Import Kaisei Opti font */
@import url('https://fonts.googleapis.com/css2?family=Kaisei+Opti:wght@400;500;700&family=Poppins:wght@400;500&display=swap');

/* CSS Custom Properties for Consistent Spacing */
:root {
    --spacing-xs: clamp(8px, 1vw, 12px);
    --spacing-sm: clamp(12px, 2vw, 18px);
    --spacing-md: clamp(18px, 3vw, 24px);
    --spacing-lg: clamp(24px, 4vw, 32px);
    --spacing-xl: clamp(32px, 6vw, 48px);
    --primary-teal: #89ECDA;
    --dark-bg: #424242;
    --text-dark: #1E1E1E;
    --text-light: #222;
}

/* Places to Discover Section */
.places-discover-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 50%, #f1f3f4 100%);
    padding: var(--spacing-xl) 0;
    min-height: 60vh;
    position: relative;
}

.places-discover-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 80%, rgba(137, 236, 218, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(137, 236, 218, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.container {
    max-width: 1424px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    position: relative;
    z-index: 2;
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.section-title {
    font-family: 'Kaisei Opti', serif;
    font-weight: 500;
    font-size: clamp(32px, 5vw, 48px);
    color: var(--text-dark);
    margin-bottom: var(--spacing-sm);
    line-height: 1.1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.section-subtitle {
    font-size: clamp(16px, 2vw, 20px);
    color: var(--text-dark);
    max-width: 816px;
    margin: 0 auto;
    line-height: 1.5;
    opacity: 0.8;
}

/* Random Masonry-Style Grid Layout */
.places-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--spacing-lg) var(--spacing-lg);
    row-gap: 100px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 100px 0;
    position: relative;
}

/* Attractive Random Positioning */
.place-card:nth-child(1) {
    transform: translateY(-20px) rotate(-2deg);
    grid-row: span 1;
    animation-delay: 0.1s;
}

.place-card:nth-child(2) {
    transform: translateY(40px) rotate(1deg);
    grid-row: span 1;
    animation-delay: 0.2s;
}

.place-card:nth-child(3) {
    transform: translateY(-60px) rotate(3deg);
    grid-row: span 1;
    animation-delay: 0.3s;
    z-index: 3;
}

.place-card:nth-child(4) {
    transform: translateY(20px) rotate(-1deg);
    grid-row: span 1;
    animation-delay: 0.4s;
}

.place-card:nth-child(5) {
    transform: translateY(-40px) rotate(2deg);
    grid-row: span 1;
    animation-delay: 0.5s;
}

.place-card:nth-child(6) {
    transform: translateY(60px) rotate(-3deg);
    grid-row: span 1;
    animation-delay: 0.6s;
}

.place-card:nth-child(7) {
    transform: translateY(10px) rotate(1deg);
    grid-row: span 1;
    animation-delay: 0.7s;
}

/* Enhanced Card Styling */
.place-card {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.1),
        0 1px 8px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    width: 100%;
    max-width: 220px;
    justify-self: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: float 6s ease-in-out infinite;
    opacity: 0;
    animation: slideInUp 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Magnetic Hover Effect */
.place-card:hover {
    transform: translateY(-15px) scale(1.05) rotate(0deg) !important;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.15),
        0 10px 20px rgba(137, 236, 218, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    z-index: 10;
}

/* Floating Animation */
@keyframes float {
    0%, 100% { transform: translateY(var(--float-y, 0px)) rotate(var(--rotate, 0deg)); }
    50% { transform: translateY(calc(var(--float-y, 0px) - 10px)) rotate(var(--rotate, 0deg)); }
}

.place-card:nth-child(1) { --float-y: -20px; --rotate: -2deg; }
.place-card:nth-child(2) { --float-y: 40px; --rotate: 1deg; }
.place-card:nth-child(3) { --float-y: -60px; --rotate: 3deg; }
.place-card:nth-child(4) { --float-y: 20px; --rotate: -1deg; }
.place-card:nth-child(5) { --float-y: -40px; --rotate: 2deg; }
.place-card:nth-child(6) { --float-y: 60px; --rotate: -3deg; }
.place-card:nth-child(7) { --float-y: 10px; --rotate: 1deg; }

/* Enhanced Image Styling */
.place-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(45deg, #f0f0f0, #e0e0e0);
}

.place-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(137, 236, 218, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.place-card:hover .place-image::before {
    opacity: 1;
}

.place-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    filter: brightness(1.1) contrast(1.05);
}

.place-card:hover .place-image img {
    transform: scale(1.1) rotate(2deg);
}

/* Enhanced Typography */
.place-name {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(14px, 1.5vw, 17px);
    font-weight: 400;
    color: var(--text-dark);
    padding: var(--spacing-md);
    text-align: center;
    margin: 0;
    line-height: 1;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    position: relative;
}

.place-name::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-teal), #7dd3c0);
    border-radius: 1px;
}

/* Staggered Entrance Animation */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(60px) rotate(var(--rotate, 0deg)) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(var(--float-y, 0px)) rotate(var(--rotate, 0deg)) scale(1);
    }
}

/* Interactive Glow Effect */
.place-card::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary-teal), #7dd3c0, var(--primary-teal));
    border-radius: 0px;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
    filter: blur(6px);
}

.place-card:hover::after {
    opacity: 0.7;
}

/* Tours We Offer Section - Exact Screenshot Match */
.tours-offer-section {
    padding: 80px 0;
    background: #fff;
}

.tours-offer-section h2 {
    text-align: center;
    font-size: 42px;
    margin-bottom: 60px;
    color: #333;
    font-weight: 600;
}

.tours-offer-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 60px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px;
}

.tours-offer-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0px;
    min-height: 300px;
    text-decoration: none;
    color: inherit;
}

.location-label {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 36px;
    font-weight: 600;
    color: #8B8B8B;
    letter-spacing: 2px;
    margin-right: 0px;
}

.tours-offer-image {
    width: 440px;
    height: 260px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Responsive Design */
@media screen and (max-width: 1200px) {
    .places-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        padding: 80px 0;
    }
    
    .place-card:nth-child(n) {
        --float-y: 0px;
        --rotate: 0deg;
    }
    
    .place-card:nth-child(odd) {
        transform: translateY(-20px) rotate(-1deg);
        --float-y: -20px;
        --rotate: -1deg;
    }
    
    .place-card:nth-child(even) {
        transform: translateY(20px) rotate(1deg);
        --float-y: 20px;
        --rotate: 1deg;
    }

    .tours-offer-grid {
        grid-template-columns: 1fr;
        max-width: 800px;
    }
}

@media screen and (max-width: 1000px) {
    .tours-offer-grid {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 0 16px;
    }

    .tours-offer-card {
        flex-direction: column;
        align-items: center;
        gap: 16px;
        text-align: center;
    }

    .tours-offer-image {
        width: 100%;
        max-width: 100%;
        height: 220px;
    }

    .location-label {
        writing-mode: horizontal-tb;
        transform: none;
        margin: 0 0 8px 0;
    }
}

@media screen and (max-width: 600px) {
    .tours-offer-section h2 {
        font-size: 32px;
        margin-bottom: 40px;
    }

    .tours-offer-card {
        padding: 12px;
    }

    .tours-offer-image {
        height: 200px;
    }

    .location-label {
        font-size: 28px;
    }
}

/* MOBILE RESPONSIVE GRID - EXACTLY 3 CARDS PER ROW WITH INCREASED HEIGHT */
@media screen and (max-width: 768px) {
    .places-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        padding: 40px 16px;
        max-width: 100%;
        margin: 0 auto;
        row-gap: 20px;
        
    }
    
    .place-card {
        transform: none !important;
        --float-y: 0px;
        --rotate: 0deg;
        max-width: none;
        width: 100%;
        border-radius: 12px;
        animation: none;
        opacity: 1;
    }
    
    .place-card:nth-child(n) {
        transform: none !important;
        animation-delay: 0s;
    }
    
    .place-image {
        height: 130px; /* Increased from 100px to 130px */
        border-radius: 12px 12px 0 0;
    }
    
    .place-name {
        font-size: 12px;
        padding: 10px 6px; /* Increased padding */
        line-height: 1.2;
    }
    
    .place-name::before {
        display: none;
    }
    
    /* Remove all animations and effects on mobile */
    .place-card:hover {
        transform: none !important;
        box-shadow: 
            0 10px 30px rgba(0, 0, 0, 0.1),
            0 1px 8px rgba(0, 0, 0, 0.06),
            inset 0 1px 0 rgba(255, 255, 255, 0.8);
    }
    
    .place-card:hover .place-image img {
        transform: none;
    }
    
    @keyframes float {
        0%, 100% { transform: none; }
        50% { transform: none; }
    }
}

/* Extra small mobile devices */
@media screen and (max-width: 480px) {
    .places-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        padding: 24px 8px;
        row-gap: 16px;
    }
    
    .place-image {
        height: 110px; /* Increased from 80px to 110px */
    }
    
    .place-name {
        font-size: 11px;
        padding: 8px 4px; /* Increased padding */
    }
}

/* Very small screens */
@media screen and (max-width: 360px) {
    .places-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        padding: 20px 8px;
        row-gap: 12px;
    }
    
    .place-image {
        height: 90px; /* Increased from 70px to 90px */
    }
    
    .place-name {
        font-size: 10px;
        padding: 6px 3px; /* Increased padding */
    }
}

/* Loading States */
.place-image.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

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

/* Accessibility */
.place-card:focus,
.tours-offer-card:focus {
    outline: 3px solid var(--primary-teal);
    outline-offset: 3px;
}

.place-card:focus-visible,
.tours-offer-card:focus-visible {
    outline: 3px solid var(--primary-teal);
    outline-offset: 3px;
}

/* Print Styles */
@media print {
    .places-discover-section,
    .tours-offer-section {
        background: white;
        padding: 20px 0;
    }
    
    .places-grid,
    .tours-offer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 20px 0;
    }
    
    .place-card,
    .tours-offer-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
        transform: none !important;
        animation: none !important;
    }
    
    .place-card::after {
        display: none;
    }
    
    .tours-offer-label {
        writing-mode: unset !important;
        transform: none !important;
    }
}

@media (max-width: 1000px) {
    .tours-offer-label.left {
        height: 180px;
    }
    .tours-offer-image {
        height: 180px;
    }
}

@media (max-width: 600px) {
    .tours-offer-label.left {
        writing-mode: unset !important;
        transform: none !important;
        height: auto;
        min-height: unset;
        flex-direction: row;
        align-items: flex-start;
        justify-content: flex-start;
        text-align: left;
        margin-bottom: 10px;
    }
    .tours-offer-image {
        height: 160px;
    }
}
