/* ============================================================
   3D UI & Modern Animated FX for Irfan Tariq Portfolio
   ============================================================ */

/* 1. Global 3D Perspective Setup */
body {
    perspective: 1200px;
    overflow-x: hidden;
}

/* 2. Hero Background 3D Canvas */
#hero-canvas-3d {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    opacity: 0.7;
}

.hero {
    position: relative;
    overflow: hidden;
}

.hero .slider-item .container {
    position: relative;
    z-index: 2;
}

/* 3. 3D Floating Hero Image & Floating Tech Badges */
.col-md-6.img {
    perspective: 1000px;
    transform-style: preserve-3d;
    transition: transform 0.5s ease-out;
}

.col-md-6.img:hover {
    transform: rotateY(-8deg) rotateX(4deg) scale(1.02);
}

.hero-3d-badge {
    position: absolute;
    padding: 10px 18px;
    background: rgba(15, 15, 20, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 189, 57, 0.3);
    border-radius: 30px;
    color: #ffbd39;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(255, 189, 57, 0.2);
    animation: floatBadge 4s ease-in-out infinite alternate;
    z-index: 5;
    transform: translateZ(40px);
}

.badge-1 { top: 20%; left: -20px; animation-delay: 0s; }
.badge-2 { bottom: 25%; right: 10px; animation-delay: 1.5s; }
.badge-3 { top: 60%; left: 10px; animation-delay: 2.5s; }

@keyframes floatBadge {
    0% { transform: translateY(0px) rotate(0deg) translateZ(30px); }
    50% { transform: translateY(-12px) rotate(2deg) translateZ(45px); }
    100% { transform: translateY(6px) rotate(-2deg) translateZ(30px); }
}

/* 4. Modern Glassmorphism & 3D Card Depth */
.services-1, .resume-wrap, .box {
    background-color: rgba(255, 255, 255, 0.02) !important;
}

.services-1 {
    cursor: default !important;
}

.project {
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
}

.project, .services-1, .resume-wrap, .box {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 16px !important;
    transform-style: preserve-3d;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), 
                box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1),
                border-color 0.4s ease !important;
    position: relative;
    overflow: hidden;
}

/* Glass shine light effect overlay */
.project::before, .services-1::before, .resume-wrap::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        90deg, 
        transparent, 
        rgba(255, 255, 255, 0.12), 
        transparent
    );
    transform: skewX(-25deg);
    transition: left 0.75s ease;
    pointer-events: none;
    z-index: 4;
}

.project:hover::before, .services-1:hover::before, .resume-wrap:hover::before {
    left: 150%;
}

/* Hover 3D Lift & Ambient Glow */
.project:hover, .resume-wrap:hover, .box:hover {
    transform: translateY(-12px) translateZ(20px) rotateX(4deg) scale(1.02) !important;
    border-color: rgba(255, 189, 57, 0.5) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 
                0 0 30px rgba(255, 189, 57, 0.25) !important;
}

.services-1:hover {
    transform: translateY(-12px) translateZ(20px) rotateX(4deg) scale(1.02) !important;
    background: linear-gradient(135deg, #ffbd39 0%, #e09900 100%) !important;
    border-color: #ffbd39 !important;
    box-shadow: 0 20px 40px rgba(255, 189, 57, 0.4) !important;
}

.services-1:hover .icon i,
.services-1:hover h3,
.services-1:hover .desc h3 {
    color: #000000 !important;
}

.services-1:hover .desc h3:after {
    background: #000000 !important;
}

/* 5. 3D Project Card Titles & Overlays */
.project .overlay {
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.85) 100%) !important;
    transition: opacity 0.4s ease;
}

.project .text {
    transform: translateZ(30px);
    transition: transform 0.4s ease;
}

.project:hover .text {
    transform: translateZ(50px) scale(1.05);
}

.project h3 a {
    color: #ffffff !important;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.project span {
    background: rgba(255, 189, 57, 0.2);
    padding: 4px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 189, 57, 0.4);
    display: inline-block;
    margin-top: 6px;
    font-size: 12px;
    letter-spacing: 1px;
}

/* 6. Glowing 3D Buttons */
.btn-primary, .btn-outline-white {
    border-radius: 30px !important;
    transform-style: preserve-3d;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease !important;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, #ffbd39 0%, #e09900 100%) !important;
    border: none !important;
    color: #000 !important;
    font-weight: 600 !important;
    box-shadow: 0 8px 20px rgba(255, 189, 57, 0.3);
}

.btn-primary:hover {
    transform: translateY(-4px) translateZ(15px) scale(1.04) !important;
    box-shadow: 0 14px 30px rgba(255, 189, 57, 0.5), 0 0 20px rgba(255, 189, 57, 0.4) !important;
}

.btn-outline-white:hover {
    transform: translateY(-4px) translateZ(15px) scale(1.04) !important;
    border-color: #ffbd39 !important;
    color: #ffbd39 !important;
    box-shadow: 0 14px 30px rgba(255, 189, 57, 0.25) !important;
}

/* 7. Enhanced 3D Progress Bars */
.progress {
    height: 12px !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border-radius: 10px !important;
    overflow: visible !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.progress-bar {
    border-radius: 10px !important;
    background: linear-gradient(90deg, #ffbd39 0%, #ff7b00 100%) !important;
    box-shadow: 0 0 12px rgba(255, 189, 57, 0.6);
    position: relative;
    transition: width 1.5s cubic-bezier(0.65, 0, 0.35, 1) !important;
}

.progress-bar span {
    position: absolute;
    right: -10px;
    top: -30px;
    background: #ffbd39;
    color: #000;
    font-weight: 700;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.progress-bar span::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 4px 4px 0;
    border-style: solid;
    border-color: #ffbd39 transparent;
}

/* 8. Glowing Headings & Text Effects */
.heading-section h2 {
    background: linear-gradient(135deg, #ffffff 30%, #ffbd39 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    font-weight: 800;
}

.heading-section h1.big {
    opacity: 0.05 !important;
    transform: translateZ(-20px);
}

/* 9. Contact Info Box 3D Lift */
.contact-info .box {
    padding: 30px 20px !important;
}

.contact-info .icon span {
    font-size: 30px;
    transition: transform 0.3s ease;
}

.contact-info .box:hover .icon span {
    transform: scale(1.2) rotate(8deg);
    color: #ffbd39;
}

/* ============================================================
   10. Comprehensive Mobile & Tablet Responsive Enhancements
   ============================================================ */

/* Mobile Navbar Toggler Button */
.navbar-toggler {
    background: rgba(255, 189, 57, 0.12) !important;
    border: 1px solid rgba(255, 189, 57, 0.5) !important;
    color: #ffbd39 !important;
    border-radius: 12px !important;
    padding: 10px 14px !important;
    outline: none !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 10px rgba(255, 189, 57, 0.2) !important;
    transition: all 0.3s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.navbar-toggler:focus, .navbar-toggler:hover, .navbar-toggler:active {
    background: rgba(255, 189, 57, 0.25) !important;
    border-color: #ffbd39 !important;
    color: #ffffff !important;
    box-shadow: 0 6px 20px rgba(255, 189, 57, 0.4) !important;
    outline: none !important;
}

.navbar-toggler i {
    color: #ffbd39 !important;
    font-size: 18px !important;
    margin: 0 !important;
}

/* Tablet & Mobile Screens (< 992px) */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background: rgba(12, 12, 18, 0.96) !important;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid rgba(255, 189, 57, 0.25);
        border-radius: 16px;
        padding: 20px;
        margin-top: 12px;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7), 0 0 20px rgba(255, 189, 57, 0.15);
    }

    .navbar-nav .nav-item .nav-link {
        padding: 10px 15px !important;
        font-size: 15px !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .hero .text h1 {
        font-size: 32px !important;
    }

    .hero .text h2 {
        font-size: 22px !important;
    }

    .hero-3d-badge {
        font-size: 11px;
        padding: 6px 12px;
    }
    
    .badge-1 { top: 10%; left: 0px; }
    .badge-2 { bottom: 15%; right: 0px; }
    .badge-3 { top: 50%; left: 10px; }
}

/* Mobile Screens (< 768px) */
@media (max-width: 767.98px) {
    body {
        perspective: none !important; /* Prevent desktop 3D perspective scroll overflow on touch devices */
    }

    /* Hero section padding & mobile height */
    .hero {
        min-height: auto !important;
        padding: 40px 0 20px !important;
    }

    .hero .slider-item {
        height: auto !important;
        min-height: 480px;
        padding-top: 20px;
    }

    .hero .text {
        text-align: center;
        padding: 20px 10px;
    }

    .hero .text h1 {
        font-size: 26px !important;
        line-height: 1.3 !important;
    }

    .hero .text h2 {
        font-size: 18px !important;
    }

    .hero .text p .btn {
        width: 100%;
        margin-bottom: 10px;
        display: block;
    }

    /* Mobile image height */
    .col-md-6.js-fullheight.img {
        height: 280px !important;
        background-size: contain !important;
        background-position: center top !important;
        margin-bottom: 20px;
    }

    /* Adjust 3D Badges for mobile touch screens */
    .hero-3d-badge {
        position: relative !important;
        top: auto !important;
        bottom: auto !important;
        left: auto !important;
        right: auto !important;
        display: inline-block !important;
        margin: 6px 4px !important;
        transform: none !important;
        animation: floatBadgeMobile 3s ease-in-out infinite alternate !important;
    }

    @keyframes floatBadgeMobile {
        0% { transform: translateY(0px); }
        100% { transform: translateY(-5px); }
    }

    /* Section Headings on Mobile */
    .heading-section h2 {
        font-size: 28px !important;
    }

    .heading-section h1.big {
        font-size: 45px !important;
    }

    /* Cards & Grid items on Mobile */
    .project {
        height: 240px !important;
        margin-bottom: 20px !important;
    }

    .project .text h3 {
        font-size: 16px !important;
    }

    .services-1 {
        padding: 1.5em !important;
        margin-bottom: 20px !important;
    }

    .resume-wrap {
        padding: 20px !important;
        margin-bottom: 20px !important;
    }

    .counter-wrap {
        margin-bottom: 20px;
    }

    .ftco-counter .block-18 {
        padding: 15px 10px !important;
    }

    .ftco-counter .text strong.number {
        font-size: 32px !important;
    }

    .contact-info .box {
        margin-bottom: 15px !important;
    }

    /* Footer Mobile Formatting */
    .ftco-footer {
        padding: 4em 0 2em 0 !important;
    }

    .ftco-footer-social li {
        margin-right: 8px !important;
    }
}

/* Small Mobile Phones (< 480px) */
@media (max-width: 479.98px) {
    .hero .text h1 {
        font-size: 22px !important;
    }
    
    .btn-primary, .btn-outline-white {
        padding: 12px 20px !important;
        font-size: 14px !important;
    }

    .project {
        height: 220px !important;
    }
}
