/* Notification styles for better user feedback */
.smt-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 5px;
    color: white;
    font-weight: bold;
    z-index: 9999;
    max-width: 400px;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

.smt-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.smt-notification.error {
    background-color: #dc3545;
    border: 1px solid #bd2130;
}

.smt-notification.success {
    background-color: #28a745;
    border: 1px solid #1e7e34;
}

.smt-notification.warning {
    background-color: #ffc107;
    color: #212529;
    border: 1px solid #d39e00;
}

.smt-notification.info {
    background-color: #17a2b8;
    border: 1px solid #138496;
}

/* Loading spinner */
.smt-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Location buttons styling - matching age group buttons exactly */
.location-button {
    padding: 12px 24px;
    background-color: #f8f9fa !important;
    border: 2px solid #e5e5e5 !important;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    color: #333;
    transition: all 0.3s ease;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    box-sizing: border-box;
}

.location-button:hover {
    background-color: #ffd1a680 !important;
    border-color: #ffd1a680 !important;
    transform: translateY(-2px);
    color: rgb(51, 51, 51) !important;
}

.location-button.active-location {
    background-color: #ff8800 !important;
    border-color: #ffd1a680 !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 136, 0, 0.3);
}

.locations-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 2px solid #f0f0f0;
}

/* Custom Tab Styles for Sublocations */
.custom-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    border-bottom: 2px solid #ff8800;
    margin-bottom: 20px;
}

.custom-tab-button {
    border: none;
    background: transparent;
    color: #666;
    font-weight: 600;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    border-radius: 0;
    transition: all 0.3s ease;
    outline: none;
}

.custom-tab-button:hover {
    color: #ff8800;
    background: #ffd1a680;
}

.custom-tab-button.active {
    color: #ff8800;
    background: white;
    border-bottom: 3px solid #ff8800;
    font-weight: 700;
}

/* Sublocation details container */
#sublocation-details-container {
    margin-top: 20px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
}

#sublocation-details-parent {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
    align-items: stretch;
}

/* Custom tab content and panes - CONSOLIDATED */
.custom-tab-content {
    position: relative;
    flex: 1;
    height: 400px;
}

.custom-tab-pane {
    /* Base styles for tab functionality */
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    
    /* Layout and visual styles */
    padding: 20px;
    background: white;
    border-radius: 8px;
    height: 100%;
    box-sizing: border-box;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow-y: auto;
}

.custom-tab-pane.active {
    display: block;
    opacity: 1;
}

.custom-tab-pane h5 {
    color: #ff8800;
    margin-top: 15px;
    margin-bottom: 5px;
    font-weight: 600;
}

.custom-tab-pane p {
    margin-bottom: 12px;
    line-height: 1.5;
}

.custom-tab-pane strong {
    color: #ff8800;
}

.custom-tab-pane ul {
    list-style-type: none;
    padding-left: 0;
    margin-top: 0;
    margin-bottom: 0;
}

.custom-tab-pane li {
    padding: 5px 0;
    border-bottom: 1px solid #f0f0f0;
}

.custom-tab-pane li:last-child {
    border-bottom: none;
}

/* Google Map styling */
#map {
    width: 100%;
    height: 400px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    flex: 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

#map.map-loading {
    opacity: 0.4;
    transform: scale(0.99);
}

#map.map-fade-out {
    opacity: 0;
    transform: scale(0.98);
}

#map.map-fade-in {
    opacity: 1;
    transform: scale(1);
}

/* General container styling */
#sublocation-details-container h4 {
    margin-bottom: 15px;
    font-size: 20px;
    color: #333;
}

#sublocation-details-container p {
    margin: 5px 0;
    font-size: 14px;
    color: #555;
}

#sublocation-details-container ul {
    list-style-type: none;
    padding-left: 0;
}

#sublocation-details-container ul li {
    font-size: 14px;
    color: #555;
}

/* Classes container styling */
.classes-parent-container {
    margin-top: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
    padding: 20px;
}

/* Utility messages */
.no-sublocations {
    font-size: 16px;
    color: #555;
    text-align: center;
    margin-top: 20px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
}

.loading-animation {
    font-size: 18px;
    color: #555;
    text-align: center;
    margin-top: 20px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
    animation: fadeIn 1s ease-in-out;
}

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

/* Testimonial Star Ratings */
.testimonial-rating {
    display: flex !important;
    gap: 5px;
    margin-bottom: 20px;
    justify-content: flex-start;
}

.testimonial-rating .star {
    font-size: 20px !important;
    color: #ff8800 !important;
    display: inline-block !important;
    line-height: 1 !important;
    font-family: Arial, sans-serif !important;
}

.testimonial-rating .star.filled {
    color: #ff8800 !important;
}

.testimonial-rating .star.empty {
    color: #ddd !important;
}

/* Responsive styles */
@media (max-width: 768px) {
    .custom-tabs {
        flex-direction: column;
    }
    
    .custom-tab-button {
        text-align: center;
        padding: 10px 15px;
    }
    
    #sublocation-details-parent {
        flex-direction: column;
    }
    
    .custom-tab-content {
        height: 300px;
        margin-bottom: 15px;
    }
    
    .custom-tab-pane {
        margin-bottom: 15px;
    }
    
    #map {
        width: 100%;
        height: 300px;
        margin-bottom: 15px;
        display: block !important;
        min-height: 300px;
        background-color: #f0f0f0; /* Temporary background to see if container is visible */
    }
}

/* Custom Blog Layout Styles */
.smt-custom-blog-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

/* Blog Category Filter Buttons */
.blog-category-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding: 20px 0;
    border-bottom: 2px solid #f0f0f0;
    background-color: transparent;
    transition: all 0.3s ease;
}

.blog-category-button {
    padding: 12px 24px;
    background-color: #f8f9fa;
    border: 2px solid #e5e5e5;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    color: #333;
    transition: all 0.3s ease;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.blog-category-button:hover {
    background-color: #ffd1a680;
    border-color: #ffd1a680;
    color: #333;
}

.blog-category-button.active {
    background-color: #ff8800;
    border-color: #ff8800;
    color: white;
}

.smt-blog-post-row {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin-bottom: 24px;
    padding: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    min-height: 300px;
    overflow: hidden;
}

.smt-blog-post-row-even {
    background: #f8fafc;
}

.smt-blog-post-row:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.smt-blog-post-image {
    flex: 0 0 25%;
    max-width: 25%;
    display: flex;
    overflow: hidden;
    position: relative;
}

.smt-blog-post-row-even .smt-blog-post-image {
    border-radius: 8px 0 0 8px;
}

.smt-blog-post-row-odd .smt-blog-post-image {
    border-radius: 0 8px 8px 0;
}

.smt-blog-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    display: block;
}

.smt-blog-post-no-image {
    width: 100%;
    height: 100%;
    background-color: #f5f5f5;
    border: none;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9e9e9e;
    font-size: 14px;
    position: absolute;
    top: 0;
    left: 0;
}

.smt-blog-post-no-image::before {
    content: "No Image";
}

.smt-blog-post-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px;
}

.smt-blog-post-category {
    margin-bottom: 16px;
}

.smt-blog-post-category .category-label {
    background: #ff8800;
    color: #fff;
    padding: 8px 16px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.smt-blog-post-title {
    margin: 0 0 16px 0;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.4;
    color: #1a202c;
}

.smt-blog-post-title a {
    color: #1a202c;
    text-decoration: none;
    transition: all 0.3s ease;
}

.smt-blog-post-title a:hover {
    color: #ff8800;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.smt-blog-post-meta {
    margin-bottom: 24px;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
}

.smt-blog-post-meta span {
    margin-right: 16px;
}

.smt-blog-post-excerpt {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.smt-blog-post-excerpt p {
    margin: 0 0 24px 0;
    color: #4a5568;
    line-height: 1.6;
    flex-grow: 1;
    font-size: 16px;
}

.smt-read-more-link {
    background: #4a7ba7;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 24px;
    border-radius: 5px;
    transition: all 0.3s ease;
    align-self: flex-start;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: inline-block;
}

.smt-read-more-link:hover {
    background: #3a6487;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    text-decoration: none;
}

/* Alternating Row Styles */
.smt-blog-post-row-odd .smt-blog-post-content {
    text-align: left;
}

.smt-blog-post-row-odd .smt-blog-post-category {
    text-align: left;
}

.smt-blog-post-row-odd .smt-blog-post-meta {
    text-align: left;
}

.smt-blog-post-row-odd .smt-blog-post-excerpt {
    text-align: left;
}

.smt-blog-post-row-odd .smt-read-more-link {
    align-self: flex-start;
}

/* Mobile Responsive - Improved */

/* Large tablets and small desktops */
@media (max-width: 1024px) {
    .smt-custom-blog-layout {
        padding: 15px;
    }
    
    .smt-blog-post-content {
        padding: 32px;
    }
    
    .smt-blog-post-title {
        font-size: 26px;
    }
}

/* Tablets */
@media (max-width: 768px) {
    .blog-category-buttons {
        padding: 20px 0;
        gap: 12px;
        justify-content: center;
    }
    
    .blog-category-button {
        padding: 14px 20px;
        font-size: 13px;
        min-height: 44px; /* Improved touch target */
        flex: 1;
        min-width: 120px;
        max-width: 200px;
    }
    
    .smt-blog-post-row {
        flex-direction: column;
        gap: 0;
        padding: 0;
        min-height: auto;
        margin-bottom: 24px;
        border-radius: 8px;
    }
    
    .smt-blog-post-image {
        flex: none;
        width: 100%;
        max-width: 100%;
        min-height: 240px;
        order: 1;
        display: flex;
        justify-content: center;
        align-items: center;
        overflow: hidden;
    }
    
    .smt-blog-post-row-even .smt-blog-post-image,
    .smt-blog-post-row-odd .smt-blog-post-image {
        border-radius: 8px 8px 0 0;
    }
    
    .smt-blog-post-content {
        order: 2;
        padding: 28px;
    }
    
    .smt-blog-post-image img {
        width: 100%;
        height: auto;
        min-height: 240px;
        object-fit: cover;
        object-position: center;
    }
    
    .smt-blog-post-no-image {
        height: 240px;
    }
    
    .smt-blog-post-title {
        font-size: 26px; /* Larger for better readability */
        line-height: 1.3;
    }
    
    .smt-blog-post-excerpt p {
        font-size: 15px;
        line-height: 1.6;
    }
    
    .smt-read-more-link {
        padding: 14px 28px;
        font-size: 14px;
        min-height: 44px; /* Better touch target */
    }
    
    .smt-custom-blog-layout {
        padding: 10px;
    }
    
    /* Reset text alignment on mobile for all rows */
    .smt-blog-post-row-odd .smt-blog-post-content,
    .smt-blog-post-row-odd .smt-blog-post-category,
    .smt-blog-post-row-odd .smt-blog-post-meta,
    .smt-blog-post-row-odd .smt-blog-post-excerpt {
        text-align: left;
    }
    
    .smt-blog-post-row-odd .smt-read-more-link {
        align-self: flex-start;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    .blog-category-buttons {
        flex-direction: column;
        gap: 10px;
        padding: 15px 0;
        align-items: stretch;
    }
    
    .blog-category-button {
        flex: none;
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        padding: 14px 16px;
        font-size: 13px;
        text-align: center;
    }
    
    .smt-blog-post-row {
        margin-bottom: 20px;
        padding: 0;
        min-height: auto;
        border-radius: 8px;
    }
    
    .smt-blog-post-image {
        width: 100%;
        min-height: 200px;
        display: flex;
        justify-content: center;
        align-items: center;
        overflow: hidden;
    }
    
    .smt-blog-post-row-even .smt-blog-post-image,
    .smt-blog-post-row-odd .smt-blog-post-image {
        border-radius: 8px 8px 0 0;
    }
    
    .smt-blog-post-image img {
        width: 100%;
        height: auto;
        min-height: 200px;
        object-fit: cover;
        object-position: center;
    }
    
    .smt-blog-post-no-image {
        height: 200px;
    }
    
    .smt-blog-post-content {
        padding: 24px 20px;
    }
    
    .smt-blog-post-title {
        font-size: 24px;
        line-height: 1.2;
        margin-bottom: 12px;
    }
    
    .smt-blog-post-meta {
        font-size: 13px;
        margin-bottom: 16px;
    }
    
    .smt-blog-post-meta span {
        margin-right: 12px;
        display: inline-block;
        margin-bottom: 4px;
    }
    
    .smt-blog-post-excerpt p {
        font-size: 14px;
        line-height: 1.5;
        margin-bottom: 18px;
    }
    
    .smt-blog-post-category .category-label {
        font-size: 11px;
        padding: 8px 14px;
        border-radius: 5px;
    }
    
    .smt-read-more-link {
        padding: 12px 24px;
        font-size: 13px;
        border-radius: 5px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        width: auto;
        max-width: 160px;
    }
    
    .smt-custom-blog-layout {
        padding: 5px;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .blog-category-button {
        font-size: 11px;
        padding: 10px 12px;
    }
    
    .smt-blog-post-content {
        padding: 20px 16px;
    }
    
    .smt-blog-post-title {
        font-size: 22px;
    }
    
    .smt-blog-post-image {
        width: 100%;
        min-height: 180px;
        display: flex;
        justify-content: center;
        align-items: center;
        overflow: hidden;
    }
    
    .smt-blog-post-image img,
    .smt-blog-post-no-image {
        height: 180px;
    }
    
    .smt-blog-post-image img {
        width: 100%;
        height: auto;
        min-height: 180px;
        object-fit: cover;
        object-position: center;
    }
}