/**
 * YMCA Maps Frontend Styles
 */

/* Map Container */
.ymca-maps-wrapper {
    margin: 0;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.ymca-map-container {
    width: 100%;
    min-height: 300px;
    background-color: #f5f5f5;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

/* Loading State */
.ymca-maps-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #666;
    font-size: 16px;
    z-index: 10;
}

.ymca-maps-loading::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e74c3c;
    border-radius: 50%;
    border-top-color: transparent;
    animation: ymca-spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

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

/* Error Messages */
.ymca-maps-error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 15px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 10px 0;
    text-align: center;
    font-size: 14px;
}

/* Info Window Styles */
.ymca-info-window {
    font-family: 'Roboto', sans-serif;
    min-width: 320px;
    max-width: 400px;
    line-height: 1.6;
    padding: 0;
    box-sizing: border-box;
}

.ymca-location-name {
    color: #e74c3c;
    font-size: 16px;
    font-weight: 700;
    margin: 2px 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #e74c3c;
    line-height: 1.3;
    word-wrap: break-word;
}

.ymca-location-details {
    font-size: 13px;
    color: #333;
    line-height: 1.5;
    padding: 0 2px;
}

.ymca-location-details > div {
    margin: 10px 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.ymca-location-details strong {
    color: #2c3e50;
    font-weight: 600;
    display: block;
    margin-bottom: 3px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.ymca-address {
    margin-bottom: 12px !important;
}

.ymca-address-text {
    margin-top: 3px;
    font-size: 13px;
    line-height: 1.4;
}

.ymca-mobile a,
.ymca-email a {
    color: #e74c3c;
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    display: inline;
    margin-top: 1px;
    padding: 1px 0;
    border-bottom: 1px solid transparent;
    transition: border-bottom-color 0.2s ease;
}

.ymca-mobile a:hover,
.ymca-email a:hover {
    border-bottom-color: #e74c3c;
}

.ymca-email-list {
    margin-top: 3px;
    line-height: 1.6;
}

.ymca-email-list a {
    display: inline;
    margin-bottom: 2px;
    margin-right: 0;
}

.ymca-email-list br {
    line-height: 1.8;
}

.ymca-contact {
    font-style: italic;
    color: #555;
    margin-top: 12px !important;
    padding-top: 10px;
    border-top: 1px solid #eee;
    font-size: 13px;
}

.ymca-contact-name {
    font-weight: 600;
    color: #2c3e50;
    margin-top: 2px;
    font-style: normal;
}

.ymca-website {
    font-style: italic;
    color: #555;
    margin-top: 12px !important;
    padding-top: 10px;
    border-top: 1px solid #eee;
    font-size: 13px;
}

.ymca-website-link {
    color: #e74c3c;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    font-style: normal;
}

.ymca-website-link:hover {
    color: #c0392b;
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .ymca-info-window {
        min-width: 300px;
        max-width: 350px;
    }
}

@media (max-width: 768px) {
    .ymca-maps-wrapper {
        margin: 15px 0;
        border-radius: 6px;
    }

    .ymca-map-container {
        min-height: 300px;
        border-radius: 6px;
    }

    .ymca-info-window {
        min-width: 280px;
        max-width: 320px;
        max-height: 300px;
        padding: 4px;
    }

    .ymca-location-name {
        font-size: 15px;
        margin-bottom: 10px;
        padding-bottom: 6px;
    }

    .ymca-location-details {
        font-size: 13px;
        padding: 0 1px;
    }

    .ymca-location-details > div {
        margin: 8px 0;
    }

    .ymca-location-details strong {
        font-size: 11px;
        margin-bottom: 4px;
    }

    .ymca-mobile a,
    .ymca-email a {
        font-size: 13px;
        padding: 3px 0;
        display: inline;
    }
}

@media (max-width: 480px) {
    .ymca-maps-wrapper {
        margin: 10px 0;
        border-radius: 4px;
    }

    .ymca-map-container {
        min-height: 280px;
        border-radius: 4px;
    }

    .ymca-info-window {
        min-width: 260px;
        max-width: 300px;
        max-height: 280px;
        padding: 6px;
    }

    .ymca-location-name {
        font-size: 14px;
        margin-bottom: 8px;
        padding-bottom: 6px;
        line-height: 1.3;
    }

    .ymca-location-details {
        font-size: 12px;
        padding: 0;
    }

    .ymca-location-details > div {
        margin: 6px 0;
    }

    .ymca-location-details strong {
        font-size: 10px;
        margin-bottom: 3px;
    }

    .ymca-mobile a,
    .ymca-email a {
        font-size: 12px;
        padding: 4px 0;
        display: inline;
    }

    .ymca-maps-loading {
        font-size: 14px;
    }

    .ymca-contact {
        margin-top: 8px !important;
        padding-top: 8px;
        font-size: 12px;
    }
}

/* Google Maps Controls Styling */
.ymca-map-container .gm-style-iw {
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    max-width: 420px !important;
    min-width: 320px !important;
    max-height: none !important;
    height: auto !important;
}

.ymca-map-container .gm-style-iw-d {
    overflow: visible !important;
    padding: 12px 12px 12px 12px;
    max-height: none !important;
    height: auto !important;
}

.ymca-map-container .gm-style-iw-c {
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    max-width: 420px !important;
    min-width: 320px !important;
    max-height: none !important;
    height: auto !important;
}

.ymca-map-container .gm-style-iw-t::after {
    background: white;
    border-radius: 50%;
}

/* Mobile Google Maps Info Window Adjustments */
@media (max-width: 768px) {
    .ymca-map-container .gm-style-iw {
        max-width: 340px !important;
        min-width: 280px !important;
        max-height: none !important;
        height: auto !important;
    }

    .ymca-map-container .gm-style-iw-c {
        max-width: 340px !important;
        min-width: 280px !important;
        max-height: none !important;
        height: auto !important;
    }

    .ymca-map-container .gm-style-iw-d {
        padding: 10px 10px 10px 10px;
        max-height: none !important;
        height: auto !important;
        overflow: visible !important;
    }
}

@media (max-width: 480px) {
    .ymca-map-container .gm-style-iw {
        max-width: 320px !important;
        min-width: 260px !important;
        max-height: 400px !important;
        height: auto !important;
        overflow-y: auto !important;
    }

    .ymca-map-container .gm-style-iw-c {
        max-width: 320px !important;
        min-width: 260px !important;
        max-height: 400px !important;
        height: auto !important;
        overflow-y: auto !important;
    }

    .ymca-map-container .gm-style-iw-d {
        padding: 8px 8px 8px 8px;
        max-height: 380px !important;
        height: auto !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }

    /* Ensure info window content is scrollable on mobile */
    .ymca-info-window {
        max-height: 360px;
        overflow-y: auto;
        overflow-x: hidden;
    }
}

/* Accessibility */
.ymca-map-container:focus {
    outline: 2px solid #e74c3c;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .ymca-maps-wrapper {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .ymca-map-container {
        background-color: #f9f9f9;
        min-height: 200px;
    }
    
    .ymca-maps-loading::before {
        display: none;
    }
}

/* Location Cards Section */
.ymca-locations-cards,
.ymca-camps-cards {
    margin-top: 30px;
    padding: 0 10px;
    width: min(var(--text-width, 1200px), 100%);
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.ymca-cards-title {
    color: #e74c3c;
    font-family: 'Roboto', sans-serif;
    font-size: var(--h2-size, 24px);
    font-weight: 700;
    margin: 0 auto 25px auto;
    text-align: center;
    border-bottom: 3px solid #e74c3c;
    padding-bottom: 15px;
    width: min(var(--text-width, 1200px), 100%);
    max-width: 100%;
}

.ymca-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 0 auto;
    width: min(var(--text-width, 1200px), 100%);
    max-width: 100%;
}

/* Individual Location Card */
.ymca-location-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
    font-family: 'Roboto', sans-serif;
}

.ymca-location-card:hover {
    box-shadow: 0 4px 16px rgba(231, 76, 60, 0.15);
    transform: translateY(-2px);
    border-color: #e74c3c;
}

/* Camp Card Hover Effect */
.ymca-camp-card:hover {
    box-shadow: 0 4px 16px rgba(46, 139, 87, 0.15);
    border-color: #2E8B57;
}

/* Card Header */
.ymca-card-header {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

/* Camp Card Header - Different color scheme */
.ymca-camp-header {
    background: linear-gradient(135deg, #2E8B57 0%, #228B22 100%);
}

.ymca-card-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    word-wrap: break-word;
}

/* Card Body */
.ymca-card-body {
    padding: 20px;
}

.ymca-card-field {
    display: flex;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 12px;
}

.ymca-card-field:last-child {
    margin-bottom: 0;
}

.ymca-card-icon {
    font-size: 18px;
    min-width: 24px;
    text-align: center;
    margin-top: 2px;
}

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

.ymca-card-label {
    display: block;
    color: #2c3e50;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.ymca-card-value {
    color: #333;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

/* Card Links */
.ymca-card-phone,
.ymca-card-email,
.ymca-card-website-link {
    color: #e74c3c;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    display: inline-block;
    margin-bottom: 2px;
}

.ymca-card-phone:hover,
.ymca-card-email:hover,
.ymca-card-website-link:hover {
    color: #c0392b;
    text-decoration: underline;
}

.ymca-card-email {
    display: block;
    margin-bottom: 4px;
}

.ymca-card-email:last-child {
    margin-bottom: 0;
}

/* No Locations Message */
.ymca-no-locations {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

/* Responsive Design for Location Cards */

/* Desktop Large (1200px+) */
@media (min-width: 1200px) {
    .ymca-cards-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 25px;
    }

    .ymca-cards-title {
        font-size: var(--h2-size, 28px);
        margin-bottom: 30px;
    }
}

/* Desktop (1024px - 1199px) */
@media (min-width: 1024px) and (max-width: 1199px) {
    .ymca-cards-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 22px;
    }

    .ymca-cards-title {
        font-size: var(--h2-size, 26px);
    }
}

/* Tablet (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .ymca-locations-cards {
        padding: 0 15px;
    }

    .ymca-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .ymca-cards-title {
        font-size: var(--h2-size, 24px);
        margin-bottom: 25px;
    }

    .ymca-card-title {
        font-size: 17px;
    }

    .ymca-card-body {
        padding: 18px;
    }

    .ymca-card-field {
        margin-bottom: 14px;
    }
}

/* Mobile (480px - 767px) */
@media (min-width: 480px) and (max-width: 767px) {
    .ymca-locations-cards,
    .ymca-camps-cards {
        margin-top: 25px;
        padding: 0 10px;
    }

    .ymca-cards-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .ymca-cards-title {
        font-size: var(--h2-size, 22px);
        margin-bottom: 20px;
        padding-bottom: 12px;
    }

    .ymca-location-card {
        border-radius: 10px;
    }

    .ymca-card-header {
        padding: 18px;
    }

    .ymca-card-title {
        font-size: 16px;
    }

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

    .ymca-card-field {
        margin-bottom: 12px;
        gap: 10px;
    }

    .ymca-card-icon {
        font-size: 16px;
        min-width: 20px;
    }

    .ymca-card-label {
        font-size: 12px;
    }

    .ymca-card-value {
        font-size: 13px;
    }
}

/* Small Mobile (<480px) */
@media (max-width: 479px) {
    .ymca-locations-cards,
    .ymca-camps-cards {
        margin-top: 20px;
        padding: 0 5px;
    }

    .ymca-cards-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .ymca-cards-title {
        font-size: var(--h2-size, 20px);
        margin-bottom: 18px;
        padding-bottom: 10px;
    }

    .ymca-location-card {
        border-radius: 8px;
        margin: 0 5px;
    }

    .ymca-card-header {
        padding: 15px;
    }

    .ymca-card-title {
        font-size: 15px;
        line-height: 1.4;
    }

    .ymca-card-body {
        padding: 14px;
    }

    .ymca-card-field {
        margin-bottom: 10px;
        gap: 8px;
    }

    .ymca-card-icon {
        font-size: 14px;
        min-width: 18px;
    }

    .ymca-card-label {
        font-size: 11px;
        margin-bottom: 3px;
    }

    .ymca-card-value {
        font-size: 12px;
        line-height: 1.4;
    }

    .ymca-card-phone,
    .ymca-card-email {
        font-size: 12px;
    }

    .ymca-no-locations {
        padding: 30px 15px;
        margin: 0 5px;
    }
}
