/* Modified Use Cases Section Styling */
.usecases.section {
    position: relative;
    overflow: hidden;
    padding: 80px 0;
    background-color: var(--background-color);
    color: var(--default-color);
}

/* Section Title using theme colors */
.usecases .section-title h2 {
    color: var(--heading-color);
    font-family: var(--heading-font);
}

.usecases .section-title p {
    margin-bottom: 50px;
    color: var(--default-color);
}

.usecases .section-title h2::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -10px;
    width: 60px;
    height: 4px;
    background: var(--accent-color);
    border-radius: 2px;
}

/* Modern Tabs using theme colors */
.custom-tabs {
    border: none;
    background: var(--surface-color);
    border-radius: 50px;
    padding: 0.5rem;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.3);
    margin-bottom: 3rem;
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    max-width: 500px;
    justify-content: center;
}

.custom-tabs .nav-item {
    margin: 0 0.25rem;
    flex: 1;
}

.custom-tabs .nav-link {
    border: none;
    padding: 0.75rem 1.75rem;
    border-radius: 50px;
    color: var(--default-color);
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    background: transparent;
}

.custom-tabs .nav-link.active,
.custom-tabs .nav-link:hover {
    background: var(--accent-color);
    color: var(--contrast-color);
    box-shadow: 0 5px 15px rgba(29, 96, 236, 0.4);
}

.custom-tabs .nav-link h4 {
    font-size: 1rem;
    margin: 0;
    font-weight: 600;
    color: inherit;
    font-family: var(--heading-font);
}

/* Industry Card Styling - Used for both tabs */
.industry-card {
    height: 280px;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.4s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.industry-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    border-color: var(--accent-color);
}

.industry-card .bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: all 0.4s ease;
}

.industry-card:hover .bg-image {
    transform: scale(1.1);
}

.industry-card .card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(3, 17, 25, 0.9) 10%, transparent 100%);
    transition: all 0.4s ease;
}

.industry-card:hover .card-overlay {
    background: linear-gradient(to top, rgba(3, 17, 25, 0.95) 30%, rgba(3, 17, 25, 0.7) 100%);
}

.industry-card .card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem;
    color: var(--contrast-color);
}

.industry-card h3 {
    color: var(--contrast-color);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    position: relative;
    transition: all 0.3s ease;
    font-family: var(--heading-font);
}

.industry-card p {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.4s ease;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    line-height: 1.5;
}

.industry-card:hover p {
    max-height: 150px;
    opacity: 1;
    margin-bottom: 1rem;
}

.industry-card .read-more {
    display: inline-flex;
    align-items: center;
    color: var(--contrast-color);
    font-weight: 600;
    text-decoration: none;
    opacity: 0;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.industry-card:hover .read-more {
    opacity: 1;
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.industry-card .read-more i {
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.industry-card .read-more:hover i {
    transform: translateX(5px);
}

/* Tab content animations */
.tab-pane {
    transition: all 0.3s ease;
}

.tab-pane:not(.show) {
    opacity: 0;
    transform: translateY(20px);
}

.tab-pane.show {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .usecases.section {
        padding: 60px 0;
    }

    .custom-tabs {
        margin-bottom: 2rem;
    }

    .industry-card {
        height: 250px;
        transition: height 0.4s ease, transform 0.4s ease, box-shadow 0.4s ease;
    }

    .industry-card:hover,
    .industry-card:active,
    .industry-card:focus {
        height: auto;
        min-height: 300px;
    }

    .industry-card .card-content {
        padding: 1.5rem;
        overflow: visible;
    }

    .industry-card:hover p,
    .industry-card:active p,
    .industry-card:focus p {
        max-height: 200px;
    }

    /* Wrapper styling for use cases */
    .usecase-content-wrapper {
        flex-direction: column;
        background-color: transparent;
        box-shadow: none;
        padding: 0;
        align-items: center;
    }

    /* Tab list styling */
    .usecase-sub-tabs {
        background: transparent;
        flex-direction: column;
        box-shadow: none;
        border-radius: 0;
        margin: 0;
        padding: 0;
        width: 100%;
        max-width: 100%;
        margin-bottom: 0;
    }

    .usecase-sub-tabs .nav-item {
        width: 100%;
        max-width: 100%;
        margin: 0 0 15px 0;
    }

    /* Style each tab like a card - Fix height overflow */
    .usecase-sub-tabs .nav-link {
        flex-direction: row;
        text-align: left;
        align-items: flex-start;
        border-radius: 12px;
        padding: 15px;
        margin: 0;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
        height: auto;
        min-height: auto;
        transition: all 0.3s ease;
    }

    /* Show descriptions in cards */
    .usecase-sub-tabs .nav-link p {
        display: block;
        margin-top: 5px;
        line-height: 1.4;
        overflow: visible;
    }

    /* Style the tab icons */
    .usecase-tab-icon {
        margin-right: 15px;
        margin-bottom: 0;
        width: 40px;
        height: 40px;
        flex-shrink: 0;
    }

    /* Style for active tab */
    .usecase-sub-tabs .nav-link.active {
        background-color: #4361ee;
    }

    /* First tab styling */
    .usecase-sub-tabs .nav-item:first-child .nav-link:not(.active) {
        background-color: #eef2ff;
    }

    /* Don't hide the tab content, but style it differently */
    .usecase-sub-tab-content {
        display: block;
        width: 100%;
    }

    /* On mobile, only show the active tab content */
    .usecase-sub-tab-content .tab-pane:not(.active) {
        display: none;
    }

    .usecase-sub-tab-content .tab-pane.active {
        display: flex;
        justify-content: center;
        background: transparent;
        box-shadow: none;
        margin-top: 0;
        padding: 0;
    }

    /* Make sure rows take full width */
    .usecase-sub-tab-content .tab-pane .row {
        width: 100%;
        margin: 0;
    }

    /* Center the image column */
    .usecase-sub-tab-content .tab-pane .col-lg-12 {
        padding: 0;
        display: flex;
        justify-content: center;
    }

    /* Adjust image styling for mobile */
    .usecase-main-image {
        max-height: 200px;
        border-radius: 12px;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        margin: 0 0 20px 0;
        width: 100%;
    }

    /* Other necessary styling */
    .usecase-detail-content {
        padding-left: 0;
        text-align: center;
    }

    .usecase-detail-icon {
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 1rem;
    }
}

@media (max-width: 768px) {
    .custom-tabs {
        border-radius: 30px;
        padding: 0.3rem;
        max-width: 100%;
    }

    .custom-tabs .nav-link {
        padding: 0.6rem 1rem;
    }

    .custom-tabs .nav-link h4 {
        font-size: 0.9rem;
    }

    .industry-card {
        height: 220px;
        transition: height 0.4s ease, transform 0.4s ease, box-shadow 0.4s ease;
    }

    .industry-card:hover,
    .industry-card:active,
    .industry-card:focus {
        height: auto;
        min-height: 280px;
        transform: translateY(-5px);
    }

    .industry-card .card-content {
        padding: 1.25rem;
        overflow: visible;
    }

    .industry-card h3 {
        font-size: 1.2rem;
    }

    .industry-card p {
        line-height: 1.4;
    }

    .industry-card:hover p,
    .industry-card:active p,
    .industry-card:focus p {
        max-height: 200px;
    }

    /* For use case tabs, full width on mobile */
    .usecase-sub-tabs .nav-item {
        max-width: 100%;
        margin-bottom: 12px;
    }

    .usecase-sub-tabs .nav-link {
        padding: 12px;
        align-items: flex-start;
    }

    /* Ensure usecase tab text wraps properly */
    .usecase-tab-text {
        flex: 1;
        overflow: visible;
    }

    .usecase-tab-text h3 {
        margin-bottom: 5px;
        line-height: 1.3;
    }

    .usecase-tab-text p {
        margin: 0;
        line-height: 1.4;
        word-wrap: break-word;
    }
}

@media (max-width: 576px) {
    .usecases.section {
        padding: 50px 0;
    }

    .section-title h2 {
        font-size: 2rem;
    }

    .custom-tabs {
        border-radius: 25px;
        padding: 0.25rem;
    }

    .custom-tabs .nav-link {
        padding: 0.5rem 0.75rem;
    }

    .custom-tabs .nav-link h4 {
        font-size: 0.85rem;
    }

    .industry-card {
        height: 200px;
        margin-bottom: 20px;
        transition: height 0.4s ease, transform 0.4s ease, box-shadow 0.4s ease;
    }

    .industry-card:hover,
    .industry-card:active,
    .industry-card:focus {
        height: auto;
        min-height: 260px;
        transform: translateY(-3px);
    }

    .industry-card .card-content {
        padding: 1rem;
        overflow: visible;
    }

    .industry-card h3 {
        font-size: 1.1rem;
        margin-bottom: 0.25rem;
    }

    .industry-card p {
        line-height: 1.3;
        font-size: 0.9rem;
    }

    .industry-card:hover p,
    .industry-card:active p,
    .industry-card:focus p {
        max-height: 180px;
    }

    .industry-card .read-more {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }

    /* Additional adjustments for very small screens */
    .usecase-content-wrapper {
        padding: 0 10px;
    }

    .usecase-sub-tabs .nav-link {
        padding: 12px;
        align-items: flex-start;
    }

    .usecase-tab-icon {
        width: 35px;
        height: 35px;
        font-size: 1rem;
        margin-right: 12px;
    }

    .usecase-tab-text h3 {
        font-size: 1rem;
        margin-bottom: 2px;
        line-height: 1.2;
    }

    .usecase-tab-text p {
        font-size: 0.75rem;
        line-height: 1.3;
        margin: 0;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

/* Animation enhancements */
@keyframes cardFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* Only apply float animation on larger screens */
@media (min-width: 993px) {
    .industry-card:hover {
        animation: cardFloat 2s ease-in-out infinite;
    }
}

/* Dark theme specific adjustments */
@media (prefers-color-scheme: dark) {
    .industry-card .card-overlay {
        background: linear-gradient(to top, var(--background-color) 10%, transparent 100%);
    }

    .industry-card:hover .card-overlay {
        background: linear-gradient(to top, var(--background-color) 30%, rgba(0, 0, 0, 0.7) 100%);
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* For touch devices, make cards expand on tap */
    .industry-card {
        cursor: pointer;
    }

    /* Add a small indicator that the card is expandable */
    .industry-card::after {
        content: "⌄";
        position: absolute;
        top: 15px;
        right: 15px;
        color: rgba(255, 255, 255, 0.7);
        font-size: 1.2rem;
        transition: transform 0.3s ease;
    }

    .industry-card:hover::after,
    .industry-card:active::after,
    .industry-card:focus::after {
        transform: rotate(180deg);
    }

    /* Ensure usecase tabs are touch-friendly */
    .usecase-sub-tabs .nav-link {
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
}
