/* =================================================================
   HOMEPAGE OPTIMIZED STYLES
   ================================================================= */

/* Base Utilities */
.image-container,
.responsive-image {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.responsive-image {
    object-fit: cover;
    object-position: center;
}

.corner-gradient::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(158deg, transparent 60%, white 80%, white 100%);
    opacity: 0.9;
    pointer-events: none;
}

/* Cards Container with Custom Scrollbar */
.cards-container {
    height: 620px;
    overflow-y: auto;
    padding: 1rem 1rem 1rem 0;
    scrollbar-width: thin;
    scrollbar-color: #5F80CF #fff;
}

/* Remove fixed height on smaller screens */
@media (max-width: 1399px) {
    .cards-container {
        height: auto;
        overflow-y: visible;
    }
}

.cards-container::-webkit-scrollbar {
    width: 8px;
}

.cards-container::-webkit-scrollbar-track {
    background-color: #fff;
    border-radius: 4px;
}

.cards-container::-webkit-scrollbar-thumb {
    background-color: #5F80CF;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.cards-container::-webkit-scrollbar-thumb:hover {
    background-color: #2980b9;
}

/* Carousel Navigation Buttons */
.btn-orange2 {
    background-color: #FE7635;
    border: none;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.btn-orange2:hover:not(.disabled-btn) {
    background-color: #e67200;
    transform: scale(1.05);
}

.disabled-btn {
    opacity: 0.5;
    cursor: not-allowed !important;
    pointer-events: none;
}

/* Carousel Cards */
.carousel-news-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #f0f0f0;
    height: 100%;
}

.carousel-news-card:hover {
    transform: translateY(-2px);
    border-color: #facab4;
}

.carousel-news-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 60%;
    overflow: hidden;
    background: #f8f9fa;
}

.carousel-news-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.carousel-news-card:hover .carousel-news-image {
    transform: scale(1.05);
}

.carousel-news-date-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #333;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.carousel-news-content {
    padding: 1.25rem;
}

.carousel-news-title {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
    color: #1a1a1a;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8rem;
}



/* More News Card */
.more-news-card {
    background: linear-gradient(135deg, #FF834A 0%, #ff6b35 100%);
    border-radius: 12px;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(255, 131, 74, 0.3);
}

.more-news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(255, 131, 74, 0.4);
}

.more-news-content {
    text-align: center;
    padding: 3rem 2rem;
    color: white;
}

.more-news-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
}

.more-news-button {
    display: inline-block;
    background: white;
    color: #FF834A;
    padding: 12px 28px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.more-news-card:hover .more-news-button {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Project Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.service-card {
    position: relative;
    height: 200px;
    overflow: hidden;
    border-radius: 8px;
    transition: transform 0.3s ease-in-out;
    text-decoration: none;
    display: block;
}

.service-card:hover {
    transform: translateY(-5px);
}

.service-card:hover .card-overlay {
    background: rgba(254, 117, 53, 0.78);
}

.card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
    transition: background 0.3s ease;
}

.card-title {
    color: white;
    font-size: 1.25rem;
    font-weight: bold;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Gradient Background */
.bg-gradient-custom {
    position: relative;
    z-index: 1;
}

.bg-gradient-custom::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background: url("https://imagedelivery.net/AFgv9dDMZXDxUz_YoX7v0w/kurrant.com/Kurrant_whoweare2.jpg/700") no-repeat center/cover;
    opacity: 0.5;
}

.bg-gradient-custom::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(-45deg, #5F80CF, #5F80CF);
    background-size: 400% 400%;
    animation: gradientAnimation 15s ease infinite;
    opacity: 0.85;
}

@keyframes gradientAnimation {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.card-glass-dark {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.4));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 10px;
}


/* Logo Carousel - WORKING + BETTER MOBILE */
.logo-container {
    position: relative;
    overflow: hidden;
    height: 50px;
    width: 100%;
}

.logo-row {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    position: absolute;
    width: 100%;
    top: 0;
    left: 0;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.logo-row.slide-up {
    transform: translateY(-100%);
    opacity: 0;
}

.logo-row.slide-in {
    transform: translateY(100%);
    opacity: 0;
}

.logo-item {
    margin: 0 25px;
    max-width: 230px;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.logo-item:hover {
    opacity: 1;
}

.logo-item img {
    width: 220px;
    max-height: 40px;
    object-fit: contain;
}

/* Tablet - keep logos readable */
@media (max-width: 991px) {
    .logo-container {
        height: 50px;
    }
    
    .logo-item {
        margin: 0 20px;
        max-width: 200px;
    }
    
    .logo-item img {
        width: 180px;
        max-height: 40px;
    }
}

/* Mobile - BIGGER logos, show only 2 */
@media (max-width: 768px) {
    .logo-container {
        height: 55px;
    }
    
    .logo-item {
        margin: 0 15px;
        max-width: 180px;
    }
    
    .logo-item img {
        width: 150px;
        max-height: 45px;
    }
    
    /* Hide 3rd logo on mobile if too crowded */
    .logo-item:nth-child(3) {
        display: none;
    }
}

/* Small phones - still keep logos VISIBLE and BIG */
@media (max-width: 480px) {
    .logo-container {
        height: 60px;
    }
    
    .logo-item {
        margin: 0 12px;
        max-width: 160px;
    }
    
    .logo-item img {
        width: 130px;
        max-height: 50px;
    }
}

.slide-in {
    transform: translateY(100%);
}

.slide-up {
    transform: translateY(-100%);
    opacity: 0;
}

/* Event Cards - Better Image Sizing for Small Screens */
.event-logo-container {
    width: 200px;
    height: auto;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    overflow: hidden;
}

.event-thumbnail {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Fix icon alignment - ensure icons stay aligned with text */
.event-dates,
.event-venue {
    display: flex;
    align-items: flex-start; /* Changed from center to flex-start */
}

.event-dates svg,
.event-venue svg {
    flex-shrink: 0; /* Prevent icon from shrinking */
    margin-top: 2px; /* Slight adjustment for better alignment */
}

/* Reduce space between logo and event name */
.event-card-body .d-flex.align-items-center {
    margin-bottom: 1rem !important; /* Reduced from mb-3 */
}

/* Mobile: Make event images MUCH BIGGER and show as list */
@media (max-width: 768px) {
    /* Hide carousel controls on mobile */
    #eventsCarousel .carousel-control-prev,
    #eventsCarousel .carousel-control-next,
    .btn-orange2.btn-circle2 {
        display: none !important;
    }
    
    /* Make all carousel items visible (remove carousel behavior) */
    #eventsCarousel .carousel-inner {
        display: block !important;
    }
    
    #eventsCarousel .carousel-item {
        display: block !important;
        opacity: 1 !important;
        position: static !important;
    }
    
    /* Hide events beyond initial 3 */
    .mobile-event-item {
        display: block;
    }
    
    .mobile-event-item.hidden-event {
        display: none;
    }
    
    /* Stack events vertically on mobile */
    #eventsCarousel .row {
        flex-direction: column;
    }
    
    #eventsCarousel .col-12 {
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 1rem;
    }
    
    .event-card-body {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .event-card-body > div:first-child {
        width: 100%;
    }
    
    .event-logo-container {
        width: 100% !important;
        max-width: 100% !important;
        height: 200px !important;
        margin: 0 0 1rem 0 !important; /* Reduced from 1.5rem */
        padding: 1rem;
    }
    
    .event-thumbnail {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        object-fit: contain !important;
    }
    
    .event-info {
        width: 100%;
        text-align: center;
    }
    
    .event-dates,
    .event-venue {
        justify-content: center !important;
    }
    
    .event-badges {
        text-align: center;
    }
    
    /* Show More button */
    .show-more-events-btn {
        margin-top: 1.5rem;
        width: 100%;
        max-width: 300px;
    }
}

/* Small phones: Even more space for logos */
@media (max-width: 576px) {
    .event-logo-container {
        height: 180px !important;
        padding: 0.75rem;
        margin-bottom: 0.75rem !important;
    }
    
    .event-card-body {
        padding: 1.5rem !important;
    }
}

/* Tablet: Medium-sized images */
@media (min-width: 769px) and (max-width: 991px) {
    .event-logo-container {
        width: 160px;
        height: 120px;
        padding: 0.5rem;
    }
    
    .event-thumbnail {
        object-fit: contain;
    }
}

/* Desktop: Original size with slight padding for better look */
@media (min-width: 992px) {
    .event-logo-container {
        width: 200px;
        min-height: 100px;
        padding: 0.5rem;
    }
    
    .event-thumbnail {
        object-fit: contain;
    }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .service-card {
        height: 100px;
    }
    
    .event-logo-container {
        width: 50px;
        height: 50px;
    }
    
    .card-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }
}

@media (min-width: 1400px) {
    .carousel-news-title {
        font-size: 1.15rem;
    }
}

/* Equal height cards for TALQ and Events sections */
@media (min-width: 1400px) {
    .col-xxl-6.d-flex {
        display: flex !important;
    }
    
    .col-xxl-6.d-flex > .mt-4 {
        width: 100%;
        display: flex;
        flex-direction: column;
    }
    
    .col-xxl-6.d-flex > .mt-4 > .card {
        flex: 1;
    }
}

/* Ensure the card body uses flexbox for proper spacing */
.col-xxl-6.d-flex .card-body.d-flex.flex-column {
    display: flex;
    flex-direction: column;
}

.col-xxl-6.d-flex .card-body.d-flex.flex-column .flex-grow-1 {
    flex-grow: 1;
}




/* Mobile News Cards */
.mobile-news-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #f0f0f0;
}

.mobile-news-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    border-color: #facab4;
}

.mobile-news-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 60%;
    overflow: hidden;
    background: #f8f9fa;
}

.mobile-news-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.mobile-news-card:hover .mobile-news-image {
    transform: scale(1.05);
}

.mobile-news-date-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 0.7rem;
    font-weight: 500;
    color: #333;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.mobile-news-content {
    padding: 1rem;
}

.mobile-news-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* Tablet Optimizations */
@media (min-width: 576px) and (max-width: 991px) {
    .mobile-news-title {
        font-size: 1.05rem;
        -webkit-line-clamp: 2;
    }
    
    .mobile-news-image-wrapper {
        padding-top: 65%;
    }
}

/* Phone Optimizations */
@media (max-width: 575px) {
    .mobile-news-card {
        margin-bottom: 0;
    }
    
    .mobile-news-content {
        padding: 0.875rem;
    }
    
    .mobile-news-title {
        font-size: 0.95rem;
    }
    
    .mobile-news-date-badge {
        font-size: 0.75rem;
        padding: 3px 8px;
    }
    
    .btn-k-orange.btn-lg {
        padding: 0.75rem 2rem;
        font-size: 1rem;
    }
}

@media (max-width: 1399px) {
    .pe-0-below-xxl {
       padding-right: 0 !important;
    }
}