/* ============================================================
   3D DESIGN SYSTEM & MODERN UI FOR TECH BLOOM ACADEMY
   ============================================================ */

/* ============================================================
   3D PERSPECTIVE & TRANSFORMS
   ============================================================ */

html {
    scroll-behavior: smooth;
}

body {
    perspective: 1000px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   3D SCENE SETUP
   ============================================================ */

.scene-3d {
    perspective: 1200px;
    position: relative;
    transform-style: preserve-3d;
}

.element-3d {
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.320, 1);
}

/* ============================================================
   DEPTH EFFECT LAYERING
   ============================================================ */

.depth-layer-1 { transform: translateZ(10px); }
.depth-layer-2 { transform: translateZ(20px); }
.depth-layer-3 { transform: translateZ(30px); }
.depth-layer-4 { transform: translateZ(40px); }
.depth-layer-5 { transform: translateZ(50px); }

/* ============================================================
   3D CARDS & COMPONENTS
   ============================================================ */

.card-3d {
    background: linear-gradient(135deg, rgba(15, 15, 35, 0.8), rgba(20, 20, 50, 0.8));
    border: 1px solid rgba(100, 200, 255, 0.2);
    border-radius: 16px;
    padding: 24px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transform-style: preserve-3d;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.card-3d::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(100, 200, 255, 0.1), rgba(150, 100, 255, 0.1));
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    border-radius: 16px;
}

.card-3d:hover {
    transform: translateY(-15px) rotateX(5deg) rotateZ(2deg) translateZ(50px);
    box-shadow: 0 30px 60px rgba(100, 200, 255, 0.3),
                0 0 40px rgba(150, 100, 255, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.card-3d:hover::before {
    opacity: 1;
}

/* ============================================================
   3D COURSES GRID
   ============================================================ */

.courses-grid-3d {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    perspective: 1200px;
    margin: 40px 0;
    padding: 20px;
}

.course-card-3d {
    position: relative;
    height: 400px;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.320, 1);
}

.course-card-3d:hover {
    transform: rotateY(-15deg) rotateX(10deg) scale(1.05);
}

.course-card-3d-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.320, 1);
}

.course-card-3d:hover .course-card-3d-inner {
    transform: rotateY(180deg);
}

.course-card-3d-front,
.course-card-3d-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 30px;
    border: 1px solid rgba(100, 200, 255, 0.2);
    background: linear-gradient(135deg, rgba(15, 15, 35, 0.9), rgba(30, 20, 60, 0.9));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.course-card-3d-front {
    z-index: 2;
    background: linear-gradient(135deg, 
        rgba(15, 15, 35, 0.95), 
        rgba(30, 20, 60, 0.95)),
        linear-gradient(45deg, 
        rgba(100, 200, 255, 0.05), 
        rgba(150, 100, 255, 0.05));
}

.course-card-3d-front::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(100, 200, 255, 0.1), transparent);
    animation: shine 8s linear infinite;
    pointer-events: none;
}

@keyframes shine {
    0% { transform: translate(-100%, -100%); }
    100% { transform: translate(100%, 100%); }
}

.course-card-3d-back {
    transform: rotateY(180deg);
    background: linear-gradient(135deg, 
        rgba(100, 200, 255, 0.15), 
        rgba(150, 100, 255, 0.15)),
        linear-gradient(45deg, 
        rgba(30, 20, 60, 0.9), 
        rgba(15, 15, 35, 0.9));
    z-index: 1;
    text-align: center;
}

.course-icon-3d {
    font-size: 60px;
    color: #00d4ff;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.5));
    animation: float 3s ease-in-out infinite;
}

.course-title-3d {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #00d4ff, #9664ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.course-level-3d {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(100, 200, 255, 0.2);
    border: 1px solid rgba(100, 200, 255, 0.4);
    border-radius: 20px;
    color: #00d4ff;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.course-price-3d {
    font-size: 1.2rem;
    color: #00ff88;
    font-weight: 700;
    margin-bottom: 20px;
}

.course-description-3d {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
}

.course-button-3d {
    background: linear-gradient(135deg, #0099ff, #006fcc);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(0, 153, 255, 0.3);
}

.course-button-3d:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(0, 153, 255, 0.5),
                0 10px 20px rgba(0, 153, 255, 0.2);
}

.course-features-list {
    text-align: left;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.course-features-list li {
    margin: 8px 0;
    padding-left: 20px;
    position: relative;
}

.course-features-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #00ff88;
    font-weight: 700;
}

/* ============================================================
   3D TEXT EFFECTS
   ============================================================ */

.text-3d {
    text-shadow: 
        2px 2px 0 rgba(100, 200, 255, 0.3),
        4px 4px 0 rgba(100, 200, 255, 0.2),
        6px 6px 0 rgba(100, 200, 255, 0.1),
        8px 8px 15px rgba(0, 0, 0, 0.3);
    transform: perspective(500px) rotateX(5deg);
}

.glow-text {
    color: #00d4ff;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5),
                 0 0 20px rgba(0, 212, 255, 0.3),
                 0 0 30px rgba(150, 100, 255, 0.2);
    filter: drop-shadow(0 0 15px rgba(0, 212, 255, 0.4));
}

/* ============================================================
   3D HOVER EFFECTS
   ============================================================ */

.hover-lift {
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hover-lift:hover {
    transform: translateY(-20px) rotateX(-10deg) scale(1.02);
    filter: drop-shadow(0 20px 40px rgba(0, 212, 255, 0.3));
}

.hover-rotate {
    transition: all 0.4s ease;
}

.hover-rotate:hover {
    transform: rotateY(10deg) rotateX(5deg);
}

/* ============================================================
   FLOATING & ANIMATION EFFECTS
   ============================================================ */

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

@keyframes pulse-glow {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
    }
    50% { 
        box-shadow: 0 0 40px rgba(0, 212, 255, 0.6);
    }
}

@keyframes rotate-3d {
    0% { transform: rotateX(0) rotateY(0) rotateZ(0); }
    100% { transform: rotateX(360deg) rotateY(360deg) rotateZ(0); }
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

.animate-rotate-3d {
    animation: rotate-3d 20s linear infinite;
}

/* ============================================================
   PARALLAX EFFECTS
   ============================================================ */

.parallax-section {
    position: relative;
    overflow: hidden;
}

.parallax-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    will-change: transform;
    z-index: 0;
}

/* ============================================================
   ENHANCED NAVIGATION FOR MOBILE
   ============================================================ */

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 6px;
    background: none;
    border: none;
    padding: 8px;
    z-index: 1001;
}

.hamburger span {
    width: 28px;
    height: 3px;
    background: linear-gradient(135deg, #00d4ff, #9664ff);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-radius: 2px;
    display: block;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(10px, 10px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(15px);
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* Navigation Menu - Mobile Friendly */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
    align-items: center;
}

.nav-item {
    position: relative;
}

.nav-item a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.nav-item a:hover,
.nav-item a.active {
    color: #00d4ff;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

/* ============================================================
   MOBILE RESPONSIVE FIXES
   ============================================================ */

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 80px;
        left: -100%;
        flex-direction: column;
        background: linear-gradient(135deg, rgba(15, 15, 35, 0.98), rgba(30, 20, 60, 0.98));
        width: 100%;
        text-align: center;
        transition: left 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        padding: 30px 0;
        gap: 20px;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-bottom: 1px solid rgba(100, 200, 255, 0.2);
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
        z-index: 999;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-item {
        width: 100%;
    }

    .nav-item a {
        display: block;
        padding: 12px 20px;
        transition: all 0.3s ease;
    }

    .nav-item a:hover {
        background: rgba(0, 212, 255, 0.1);
        border-left: 3px solid #00d4ff;
        padding-left: 17px;
    }

    /* Fix mobile menu closing */
    .nav-menu.active.closing {
        animation: slideOut 0.3s ease-out forwards;
    }

    @keyframes slideOut {
        from { left: 0; }
        to { left: -100%; }
    }

    /* Courses Grid - Mobile */
    .courses-grid-3d {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 10px;
    }

    .course-card-3d {
        height: 350px;
    }

    .course-card-3d:hover {
        transform: rotateY(-15deg) scale(1.02);
    }

    /* 3D Effects - Reduced for Mobile */
    .card-3d {
        padding: 16px;
    }

    .card-3d:hover {
        transform: translateY(-10px) translateZ(30px);
    }
}

@media (max-width: 480px) {
    .hamburger span {
        width: 24px;
        height: 2.5px;
    }

    .nav-menu {
        top: 70px;
        padding: 20px 0;
        gap: 10px;
    }

    .courses-grid-3d {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 5px;
    }

    .course-card-3d {
        height: 300px;
    }

    .course-card-3d-front,
    .course-card-3d-back {
        padding: 20px;
    }

    .course-icon-3d {
        font-size: 40px;
        margin-bottom: 10px;
    }

    .course-title-3d {
        font-size: 1.2rem;
        margin-bottom: 5px;
    }

    /* Prevent landscape scrolling issues */
    html, body {
        overflow-x: hidden;
    }

    .card-3d:hover {
        transform: translateY(-8px);
    }
}

/* ============================================================
   ENSURE PROPER Z-INDEX STACKING
   ============================================================ */

.navbar {
    position: relative;
    z-index: 100;
}

.loading-screen {
    z-index: 10000;
}

/* ============================================================
   ACCESSIBILITY & PERFORMANCE
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .card-3d:hover {
        transform: none;
    }

    .course-card-3d:hover {
        transform: scale(1.02);
    }
}

/* ============================================================
   SMOOTH SCROLLBAR (Optional)
   ============================================================ */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(15, 15, 35, 0.5);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #0099ff, #9664ff);
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #00d4ff, #b878ff);
}
