/* Fade-in on load */
.custom-card {
    opacity: 0; /* Start fully transparent */
    transform: scale(0.95) translateY(20px); /* Slightly smaller and shifted down */
    animation: fadeIn 1s ease-in-out forwards; /* Fade-in animation */
    animation-delay: 0.2s; /* Optional delay to stagger */
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Hover transition for grow effect */
}

/* Grow effect on hover */
.custom-card:hover {
    transform: scale(1.02); /* Subtle grow on hover */
    box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.3); /* Add a larger shadow */
    border-color: var(--secondary-color);
}

/* Fade-in animation */
@keyframes fadeIn {
    from {
        opacity: 0; /* Fully transparent */
        transform: scale(0.95) translateY(20px); /* Slightly smaller and shifted down */
    }
    to {
        opacity: 1; /* Fully visible */
        transform: scale(1) translateY(0); /* Full size and original position */
    }
}

/* Custom card link */
.custom-card-link {
    text-decoration: none;
    color: inherit;
}

/* Custom card styling - modernized and simplified */
.custom-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.1);
    padding: 0; /* Remove default padding to allow for better content control */
    text-align: center;
    margin-bottom: 20px;
    transition: all 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    align-items: stretch; /* Changed from center to stretch for full-width content */
    overflow: hidden; /* Ensure content doesn't overflow rounded corners */
}

/* Enhanced styling for service cards */
#services-section .custom-card {
    transform: translateY(0);
    transition: all 0.4s ease;
    border-bottom: 3px solid transparent;
}

#services-section .custom-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    border-bottom: 3px solid var(--secondary-color);
}

/* Individual card animations */
#services-section .column:nth-child(1) .custom-card {
    animation: fadeInUp 0.6s ease-out 0.3s forwards;
    opacity: 0;
}

#services-section .column:nth-child(2) .custom-card {
    animation: fadeInUp 0.6s ease-out 0.45s forwards;
    opacity: 0;
}

#services-section .column:nth-child(3) .custom-card {
    animation: fadeInUp 0.6s ease-out 0.6s forwards;
    opacity: 0;
}

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

/* Special styling for cards in the info section with parallax background - modernized design */
#info-section .custom-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: none;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.4s ease;
    opacity: 0;
    transform: translateY(20px);
}

/* Animation for cards when they become visible */
#info-section .custom-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Hover effect for cards in the info section */
#info-section .custom-card.hover-effect {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.75);
}

/* Card toolbar for titles - modernized, more elegant design */
.card-toolbar {
    padding: 18px 20px;
    text-align: center; /* Center align the title */
    margin-bottom: 0;
    width: 100%; /* Ensure the toolbar spans the full width of the card */
    box-sizing: border-box;
    border-bottom: 1px solid rgba(198, 40, 40, 0.3); /* Lighter red accent border */
    position: relative; /* For proper positioning of elements */
}

/* Toolbar title icons */
.card-toolbar .title i {
    color: var(--secondary-color); /* Red accent color */
    margin-right: 10px;
}

.card-toolbar .title {
    color: var(--primary-color); /* Changed to primary color for better theme integration */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 0;
}

/* Card content styling */
.custom-card .card-content {
    padding: 20px;
}

/* Card image styling */
.custom-card .card-image {
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px 15px 0;
}

.custom-card .card-image .image img {
    width: 200px;
    height: 200px;
    border-radius: 4px; /* Sharper corners for industrial look */
    border: 3px solid var(--accent-color); /* Blue-gray border */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.custom-card:hover .card-image .image img {
    border-color: var(--secondary-color); /* Red border on hover */
}

/* Equal height cards */
.columns.is-multiline .column .custom-card {
    height: 100%;
}

/* Accent background - now with parallax effect */
.section.has-accent-background {
    position: relative;
    padding-top: 50px;
    padding-bottom: 50px;
    border-top: 3px solid var(--secondary-color);
    border-bottom: 3px solid var(--secondary-color);
    z-index: 1;
}

/* Parallax effect for services section */
#services-section {
    position: relative;
    background-image: url('../../images/gallery/classic-beauties.jpg');
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    color: var(--text-color);
    padding-top: 70px;
    padding-bottom: 70px;
}

#services-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(236, 239, 241, 0.85); /* Light opaque overlay using light-accent color */
    z-index: 0;
}

#services-section .container {
    position: relative;
    z-index: 1;
}

/* Creative styling for services section title */
#services-section .section-title-container {
    position: relative;
    margin-bottom: 50px;
    text-align: center;
}

#services-section .section-title {
    display: inline-block;
    position: relative;
    font-family: "Oswald", "Roboto Condensed", sans-serif;
    font-size: 2.0rem;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
    padding: 0 15px;
    z-index: 2;
}

#services-section .section-title::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: -10px;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--secondary-color), transparent);
}

#services-section .section-title::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -22px;
    width: 25px;
    height: 25px;
    background-color: var(--secondary-color);
    transform: translateX(-50%) rotate(45deg);
    z-index: -1;
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

#services-section .section-subtitle {
    font-family: "Roboto Condensed", sans-serif;
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--primary-color);
    max-width: 700px;
    margin: 30px auto 20px;
    position: relative;
    z-index: 2;
    display: inline-block;
    padding: 6px 12px;
    background: linear-gradient(120deg, rgba(236, 239, 241, 0.7) 0%, rgba(144, 202, 249, 0.5) 50%, rgba(236, 239, 241, 0.7) 100%);
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(144, 202, 249, 0.3);
    border-left: 3px solid rgba(26, 58, 95, 0.3);
    border-right: 3px solid rgba(26, 58, 95, 0.3);
    transition: all 0.3s ease;
    clear: both; /* Ensure it stays below the title */
}

#services-section .section-subtitle:hover {
    background: linear-gradient(120deg, rgba(236, 239, 241, 0.8) 0%, rgba(144, 202, 249, 0.6) 50%, rgba(236, 239, 241, 0.8) 100%);
    box-shadow: 0 4px 15px rgba(144, 202, 249, 0.4);
    transform: translateY(-2px);
}

/* Animation classes for services section title */
.title-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.title-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

.subtitle-animate {
    opacity: 0;
    transform: translateY(20px);
    transition: all 2s ease-out;
}

.subtitle-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive adjustments for services section title */
@media screen and (max-width: 1023px) {
    #services-section .section-title {
        font-size: 2.2rem;
        letter-spacing: 1.5px;
    }

    #services-section .section-title::after {
        width: 20px;
        height: 20px;
        bottom: -20px;
    }

    #services-section .section-subtitle {
        font-size: 1rem;
        margin: 25px auto 15px;
        padding: 5px 10px;
        background: linear-gradient(120deg, rgba(236, 239, 241, 0.75) 0%, rgba(144, 202, 249, 0.55) 50%, rgba(236, 239, 241, 0.75) 100%);
    }
}

@media screen and (max-width: 768px) {
    #services-section {
        padding-top: 50px;
        padding-bottom: 50px;
    }

    #services-section .section-title-container {
        margin-bottom: 35px;
    }

    #services-section .section-title {
        font-size: 1.8rem;
        letter-spacing: 1px;
        padding: 0 10px;
    }

    #services-section .section-title::after {
        width: 20px;
        height: 20px;
        bottom: -18px;
    }

    #services-section .section-subtitle {
        font-size: 0.95rem;
        margin: 22px auto 10px;
        padding: 4px 8px;
        background: linear-gradient(120deg, rgba(236, 239, 241, 0.8) 0%, rgba(144, 202, 249, 0.6) 50%, rgba(236, 239, 241, 0.8) 100%);
        box-shadow: 0 2px 8px rgba(144, 202, 249, 0.25);
        border-left: 2px solid rgba(26, 58, 95, 0.25);
        border-right: 2px solid rgba(26, 58, 95, 0.25);
        max-width: 90%;
        display: block; /* Ensure it's a block element on small screens */
    }

    #services-section .section-subtitle:hover {
        transform: translateY(-1px);
    }

    /* Ensure animations are visible on mobile */
    .title-animate, .subtitle-animate {
        opacity: 1;
        transform: translateY(0);
    }

    /* Disable card animations on mobile for better performance and ensure visibility */
    #services-section .column .custom-card {
        animation: none !important;
        opacity: 1 !important; /* Force opacity to ensure visibility */
        transform: translateY(0) !important; /* Reset any transform that might affect visibility */
        visibility: visible !important; /* Explicitly set visibility */
    }

    /* Ensure columns container is visible on small screens */
    #services-section .columns.is-multiline {
        display: flex !important;
        flex-wrap: wrap !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    /* Force columns to stack vertically on mobile */
    #services-section .columns.is-multiline .column {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }
}

/* Accreditation display - modernized */
.accreditation-display {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    padding: 10px 0;
}

.accreditation-display img {
    height: 140px;
    transition: all 0.3s ease;
    filter: brightness(1);
    border-radius: 8px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.accreditation-display img:hover {
    transform: translateY(-3px);
    filter: brightness(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.15);
}

@media screen and (max-width: 768px) {
    .accreditation-display img {
        height: 120px;
    }
}

/* Hours table styling - improved separators */
.table.is-styled {
    background-color: transparent;
    margin-bottom: 0;

}

.table.is-styled tr {
    border-bottom: 1px solid rgba(198, 40, 40, 0.15); /* Using secondary-color with transparency */
    background-color: transparent;
    transition: background-color 0.2s ease;
}

.table.is-styled tr:hover {
    background-color: rgba(26, 58, 95, 0.05); /* Subtle hover effect using primary color */
}

.table.is-styled tr:last-child {
    border-bottom: none;
}

.table.is-styled td {
    background-color: transparent;
    color: inherit;
    padding: 0.75rem 1rem;
    vertical-align: middle;
    font-weight: bold !important;
}

/* Responsive Map Wrapping */
@media screen and (max-width: 768px) {
    .column.is-two-thirds {
        order: 2;
    }

    .column.is-one-third {
        order: 1;
    }
}

/* Parallax effect for info section */
#info-section {
    position: relative;
    background-image: url('../../images/gallery/IMG_2264.JPG');
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    color: var(--light-text);
    padding: 60px 0;
}

/* Responsive adjustments for parallax effect */
@media screen and (max-width: 768px) {
    #info-section, #services-section {
        background-attachment: scroll; /* Fallback to scroll on mobile for better performance */
        padding: 40px 0;
    }

    /* Remove background for services section on mobile */
    #services-section {
        background-image: none;
        background-color: var(--light-accent); /* Light background color instead of parallax */
    }

    /* Remove the overlay since we don't have a background image */
    #services-section::before {
        display: none;
    }

    #info-section .custom-card {
        margin-bottom: 15px;
    }

    /* Force info section columns to stack vertically on mobile */
    #info-section .columns .column {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }
}

/* Ensure smooth scrolling on all devices */
@media screen and (max-width: 1024px) {
    #info-section, #services-section {
        background-position: center center;
    }
}

#info-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.6); /* Darkened overlay for better readability and card contrast */
    z-index: 0;
}

#info-section .container {
    position: relative;
    z-index: 1;
    padding-top: 100px;
    padding-bottom: 100px;
}

/* Match card heights */
#info-section .columns .column.is-one-third {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.map-container, .map-container iframe {
    width: 100% !important;
    height: 100% !important; /* Ensure the iframe fills the card height */
    border: 0;
    min-height: 400px;
    border-radius: 0; /* Remove border radius to match new card styling */
}

/* Footer placement fix */
footer {
    position: relative;
    z-index: 1;
    margin-top: 20px;
}

/* Carousel images - reduce brightness for more realistic auto shop feel */
.carousel-item img {
    filter: brightness(100%) contrast(110%); /* More realistic brightness */
    transition: filter 0.3s ease, opacity 0.3s ease; /* Smooth transition for image effects */
}

/* Enhance the overlay text */
.carousel-overlay {
    padding: 25px;
    border-radius: 4px;
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.3); /* Stronger shadow for depth */
}

/* Service titles */
.custom-card .card-content .title {
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
}

/* Service card horizontal rules */
.custom-card .card-content hr {
    background-color: var(--secondary-color);
    height: 2px;
    width: 50px;
    margin: 10px auto 15px;
    opacity: 0.8;
}

/* Enhanced styling for service card content */
#services-section .custom-card .card-image {
    position: relative;
    overflow: hidden;
    padding-bottom: 0;
}

#services-section .custom-card .card-image img {
    transition: all 0.5s ease;
}

#services-section .custom-card:hover .card-image img {
    transform: scale(1.05);
}

#services-section .custom-card .card-content {
    padding: 25px 20px;
    position: relative;
}

#services-section .custom-card .card-content .title {
    margin-bottom: 5px;
    font-size: 1.5rem;
}

#services-section .custom-card .card-content .subtitle {
    color: var(--accent-color);
    font-size: 1rem;
    line-height: 1.5;
}

/* Responsive adjustments for service cards */
@media screen and (max-width: 768px) {
    #services-section .custom-card .card-content {
        padding: 20px 15px;
    }

    #services-section .custom-card .card-content .title {
        font-size: 1.3rem;
    }

    #services-section .custom-card .card-content .subtitle {
        font-size: 0.95rem;
    }
}
