* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    color: #2d3748;
    overflow-x: hidden;
}

.container {
    /*width: 90%;*/
    /*margin: 0 auto;*/
    height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1.8fr;
    grid-template-rows: auto 1fr;
    grid-template-areas:
                "header header"
                "locations map";
    margin-bottom: 50px;

}

.header {
    grid-area: header;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: clamp(15px, 4vw, 40px) clamp(20px, 6vw, 60px) clamp(12px, 3vw, 30px);
    position: relative;
    border-bottom: 1px solid rgba(45, 55, 72, 0.08);
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /*background: linear-gradient(45deg, transparent 48%, rgba(72, 187, 170, 0.02) 50%, transparent 52%);*/
    animation: subtleShine 8s infinite;
}

@keyframes subtleShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.header-content {
    position: relative;
    z-index: 2;
}

.header h1 {
    font-size: clamp(26px, 5vw, 40px);
    font-weight: 300;
    color: #2d3748;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.header p {
    font-size: clamp(13px, 2vw, 16px);
    color: #718096;
    font-weight: 400;
    letter-spacing: 0.01em;
}

.locations-panel {
    grid-area: locations;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    position: relative;
    overflow: hidden;
    border-right: 1px solid rgba(45, 55, 72, 0.08);
}

.locations-panel::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, transparent, rgba(72, 187, 170, 0.1), transparent);
    pointer-events: none;
}

.locations-list {
    padding: clamp(15px, 4vw, 50px) clamp(20px, 4vw, 40px);
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 2vw, 20px);
}

.location-item {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(45, 55, 72, 0.06);
    border-radius: 8px;
    /* Changed: Use min-height instead of fixed height and let content determine size */
    min-height: fit-content;
    padding: clamp(14px, 3vw, 24px) clamp(18px, 3vw, 28px);
    /* Added: Ensure proper spacing for the number badge */
    padding-right: clamp(50px, 8vw, 70px);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: visible; /* Changed: Allow content to be visible */
    transform: translateX(-10px);
    opacity: 0;
    animation: gentleSlideIn 0.6s ease forwards;
    /* Added: Ensure text wraps properly */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.location-item.active {
    animation-delay: 0.1s;
}

@keyframes gentleSlideIn {
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.location-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(72, 187, 170, 0.03), transparent);
    transition: left 0.6s ease;
}

.location-item:hover::before {
    left: 100%;
}

.location-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(72, 187, 170, 0.08);
    border-color: rgba(72, 187, 170, 0.15);
}

.location-item.active {
    background: rgba(72, 187, 170, 0.04);
    border-color: rgba(72, 187, 170, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(72, 187, 170, 0.1);
}

.location-number {
    position: absolute;
    top: clamp(10px, 2vw, 16px);
    right: clamp(10px, 2vw, 16px);
    width: clamp(20px, 3vw, 24px);
    height: clamp(20px, 3vw, 24px);
    background: linear-gradient(135deg, #48bbaa, #40a5a5);
    color: #ffffff;
    font-size: clamp(10px, 1.5vw, 12px);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-family: 'Courier New', monospace;
    box-shadow: 0 2px 8px rgba(72, 187, 170, 0.2);
    /* Added: Ensure number badge stays visible */
    z-index: 1;
}

.location-title {
    font-size: clamp(15px, 3vw, 21px);
    font-weight: 500;
    color: #2d3748;
    margin-bottom: clamp(8px, 1vw, 10px);
    letter-spacing: -0.01em;
    /* Added: Ensure title text wraps properly */
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.location-address {
    font-size: clamp(12px, 2vw, 14px);
    color: #4a5568;
    line-height: 1.5;
    margin-bottom: clamp(12px, 2vw, 16px);
    /* Added: Ensure address text wraps properly */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.location-contact {
    display: flex;
    flex-direction: column;
    gap: clamp(4px, 1vw, 6px);
    font-size: clamp(11px, 2vw, 14px);
    color: #48bbaa;
    font-weight: 400;
    /* Added: Ensure contact text wraps properly */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.map-panel {
    grid-area: map;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    position: relative;
    overflow: hidden;
}

.map-container {
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
}

#map {
    flex: 1;
    width: 100%;
    height: 100%;
}

.map-overlay {
    position: absolute;
    bottom: clamp(10px, 4vw, 30px);
    left: clamp(10px, 4vw, 30px);
    right: clamp(10px, 4vw, 40px);
    width: 60%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: clamp(6px, 2vw, 14px) clamp(8px, 2vw, 16px); /* Half padding */
    border-radius: 12px;
    border: 1px solid rgba(45, 55, 72, 0.08);
    color: #2d3748;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    z-index: 10;
}

.map-overlay h3 {
    font-size: clamp(14px, 2vw, 18px); /* Reduced font size */
    font-weight: 500;
    margin-bottom: clamp(6px, 0.8vw, 8px); /* Slightly reduced margin */
    color: #2d3748;
}

.map-overlay p {
    font-size: clamp(10px, 1.5vw, 12px); /* Reduced font size */
    line-height: 1.5;
    color: #4a5568;
    margin-bottom: clamp(10px, 1.5vw, 14px); /* Slightly reduced margin */
}


.directions-btn {
    background: linear-gradient(135deg, #48bbaa, #40a5a5);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: clamp(6px, 2vw, 10px) clamp(14px, 3vw, 20px);
    font-size: clamp(12px, 2vw, 14px);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.directions-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(72, 187, 170, 0.3);
}

.floating-elements {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 5;
}

.floating-element {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(72, 187, 170, 0.15);
    border-radius: 50%;
    animation: gentleFloat 12s infinite ease-in-out;
}

.floating-element:nth-child(1) { top: 15%; left: 15%; animation-delay: 0s; }
.floating-element:nth-child(2) { top: 70%; left: 85%; animation-delay: 4s; }
.floating-element:nth-child(3) { top: 40%; left: 30%; animation-delay: 8s; }
.floating-element:nth-child(4) { top: 80%; left: 60%; animation-delay: 2s; }
.floating-element:nth-child(5) { top: 25%; left: 75%; animation-delay: 6s; }

@keyframes gentleFloat {
    0%, 100% { transform: translateY(0px); opacity: 0.3; }
    50% { transform: translateY(-15px); opacity: 0.7; }
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(248, 249, 250, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(72, 187, 170, 0.3);
    border-top: 3px solid #48bbaa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    color: #e53e3e;
    text-align: center;
    padding: 20px;
    font-size: clamp(12px, 2vw, 14px);
}

/* Tablet Styles - Only layout changes, no font declarations */
@media (max-width: 1200px) {
    .container {
        grid-template-columns: 1fr 1.5fr;
    }
}

/* Large Mobile/Small Tablet - Only layout changes */
@media (max-width: 1024px) {
    .container {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(300px, 40vh) 1fr;
        grid-template-areas:
                    "header"
                    "locations"
                    "map";
        margin-bottom: 0;
    }

    .locations-panel {
        height: auto;
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid rgba(45, 55, 72, 0.08);
    }

    .locations-list {
        max-height: 35vh;
        overflow-x: hidden;
    }

    .map-overlay {
        width: 90%;
    }
}

/* Mobile Styles - Only layout changes */
@media (max-width: 768px) {
    .container {
        grid-template-rows: auto minmax(250px, 35vh) 1fr;
    }

    .locations-list {
        max-height: 30vh;
    }
}

/* Small Mobile - Only layout changes */
@media (max-width: 480px) {
    .container {
        grid-template-rows: auto minmax(200px, 30vh) 1fr;
    }

    .locations-list {
        max-height: 25vh;
    }

    /* Disable some animations on small screens for better performance */
    .location-item::before,
    .floating-elements,
    .header::before {
        display: none;
    }
}

/* Landscape orientation adjustments */
@media (max-width: 1024px) and (orientation: landscape) {
    .container {
        grid-template-columns: 350px 1fr;
        grid-template-rows: auto 1fr;
        grid-template-areas:
                    "header header"
                    "locations map";
    }

    .locations-panel {
        height: auto;
        max-height: none;
        border-right: 1px solid rgba(45, 55, 72, 0.08);
        border-bottom: none;
    }

    .locations-list {
        max-height: none;
        height: 100%;
    }

    .map-overlay {
        width: 50%;
    }
}

@media (max-width: 768px) and (orientation: landscape) {
    .container {
        grid-template-columns: 280px 1fr;
    }
}

/* Fix for very short screens */
@media (max-height: 500px) {
    .container {
        grid-template-rows: auto minmax(150px, 25vh) 1fr;
    }

    .locations-list {
        max-height: 20vh;
    }
}