@php
    $home = \App\Models\Home::first();
    $topheader = \App\Models\TopHeader::first();
@endphp
<div class="apply-section">
    <div class="apply-bg">
        <img src="{{ asset('storage/' . $home->bottom_image) }}" alt="Graduates" />
        <div class="apply-overlay"></div>
        <div class="apply-text">
            {{ $home->bottom_text }}
        </div>
    </div>
    <div class="apply-actions">
        @if ($topheader->requestinfo_status)
            <a href="{{ $topheader->requestinfo_link }}" class="apply-btn">{{ strtoupper($topheader->requestinfo) }}</a>
        @endif
        @if ($topheader->applynow_status)
            <a href="{{ $topheader->apply_now_link }}" class="apply-btn">{{ strtoupper($topheader->apply_now) }}</a>
        @endif
    </div>
</div>
<style>
    .apply-section {
    display: flex;
    align-items: stretch;
    width: 100%;
    height: 150px;
    background: #fff;
    position: relative;
    overflow: hidden;
}

.apply-bg {
    width: 60%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    overflow: hidden;
}

.apply-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    min-height: 120px;
    filter: brightness(0.7);
    display: block;
}

.apply-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(10, 76, 118, 0.45);
    z-index: 1;
}

.apply-text {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 2rem;
    font-weight: bold;
    letter-spacing: 2px;
    z-index: 2;
    text-align: center;
    white-space: nowrap;
}

.apply-actions {
    width: 40%;
    background: #fafbfc;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    position: relative;
    clip-path: polygon(12% 0, 100% 0, 100% 100%, 0 100%);
}

.apply-btn {
    background: #F6A84F;
    color: #fff;
    padding: 12px 28px;
    border-radius: 5px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    border: none;
    transition: background 0.2s, color 0.2s;
    letter-spacing: 1px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: inline-block;
    text-align: center;
}

.apply-btn:hover {
    background: #17486D;
    color: #fff;
}
   /* Enhanced responsive styles */
   @media (max-width: 1200px) {
        .apply-section {
            height: 140px;
        }
        .apply-text {
            font-size: 1.8rem;
            letter-spacing: 1.5px;
        }
        .apply-actions {
            gap: 20px;
        }
        .apply-btn {
            padding: 11px 25px;
            font-size: 0.95rem;
        }
    }

    @media (max-width: 992px) {
        .apply-section {
            height: 130px;
        }
        .apply-text {
            font-size: 1.6rem;
            letter-spacing: 1px;
        }
        .apply-actions {
            gap: 18px;
        }
        .apply-btn {
            padding: 10px 22px;
            font-size: 0.9rem;
        }
    }

    @media (max-width: 768px) {
        .apply-section {
            flex-direction: column;
            height: auto;
            min-height: 200px;
        }
        .apply-bg {
            width: 100%;
            height: 120px;
        }
        .apply-bg img {
            min-height: 100px;
        }
        .apply-text {
            font-size: 1.4rem;
            letter-spacing: 0.8px;
            white-space: normal;
            padding: 0 20px;
        }
        .apply-actions {
            width: 100%;
            height: 80px;
            clip-path: none;
            gap: 15px;
        }
        .apply-btn {
            padding: 9px 20px;
            font-size: 0.85rem;
        }
    }

    @media (max-width: 600px) {
        .apply-section {
            min-height: 180px;
        }
        .apply-bg {
            height: 100px;
        }
        .apply-bg img {
            min-height: 80px;
        }
        .apply-text {
            font-size: 1.2rem;
            letter-spacing: 0.5px;
            padding: 0 15px;
        }
        .apply-actions {
            height: 80px;
            gap: 12px;
        }
        .apply-btn {
            padding: 8px 18px;
            font-size: 0.8rem;
        }
    }

    @media (max-width: 480px) {
        .apply-section {
            min-height: 160px;
        }
        .apply-bg {
            height: 90px;
        }
        .apply-bg img {
            min-height: 70px;
        }
        .apply-text {
            font-size: 1.1rem;
            letter-spacing: 0.3px;
            padding: 0 12px;
        }
        .apply-actions {
            height: 70px;
            gap: 10px;
        }
        .apply-btn {
            padding: 7px 16px;
            font-size: 0.75rem;
        }
    }

    @media (max-width: 360px) {
        .apply-section {
            min-height: 140px;
        }
        .apply-bg {
            height: 80px;
        }
        .apply-bg img {
            min-height: 60px;
        }
        .apply-text {
            font-size: 1rem;
            letter-spacing: 0.2px;
            padding: 0 10px;
        }
        .apply-actions {
            height: 60px;
            gap: 8px;
        }
        .apply-btn {
            padding: 6px 14px;
            font-size: 0.7rem;
        }
    }

    /* Ensure proper button layout on very small screens */
    @media (max-width: 480px) {
        .apply-actions {
            flex-direction: column;
            height: auto;
            padding: 15px 0;
        }
        .apply-btn {
            width: 80%;
            max-width: 200px;
        }
    }

    @media (max-width: 360px) {
        .apply-actions {
            padding: 12px 0;
        }
        .apply-btn {
            width: 85%;
            max-width: 180px;
        }
    }


</style>
