/* ================================================ */
/* Modern UI Enhancements for Jude's Portfolio     */
/* ================================================ */

/* Enhanced Scroll Behavior - disabled to fix lag */
/* html {
    scroll-behavior: smooth;
} */

/* Modern Glassmorphism Effects */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Enhanced Card Hover Effects */
.enhanced-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.enhanced-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transition: left 0.6s ease;
    z-index: 1;
}

.enhanced-card:hover::before {
    left: 100%;
}

.enhanced-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* 3D Model Background for Home Section */
.home-3d-model {
    position: fixed;
    top: 0;
    right: -15vw;
    width: 85vw;
    height: 100vh;
    z-index: 10;
    opacity: 0.9;
    transform: scale(1);
    pointer-events: auto;
    cursor: grab;
    transition: opacity 0.5s ease;
}

.home-3d-model:active {
    cursor: grabbing;
}

.home-3d-model canvas {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
}

/* Hide 3D model when not in home section */
.home-3d-model.hidden {
    opacity: 0;
    pointer-events: none;
}

/* 3D Model Viewer Styles (for portfolio section if needed) */
.model-showcase {
    padding: 2rem;
    border-radius: var(--_radius-l);
    margin: 2rem 0;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s ease;
}

.model-showcase:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}

.model-showcase__header {
    text-align: center;
    margin-bottom: 2rem;
}

.model-showcase__title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--accent), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.model-showcase__subtitle {
    font-size: 1.1rem;
    color: var(--t-muted);
    margin: 0;
    opacity: 0.8;
}

.model-viewer-container {
    position: relative;
    margin: 2rem 0;
}

.model-viewer {
    width: 100%;
    height: 500px;
    border-radius: var(--_radius-m);
    overflow: hidden;
    background: linear-gradient(135deg, rgba(112, 89, 226, 0.1), rgba(170, 112, 224, 0.1));
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.model-viewer canvas {
    border-radius: var(--_radius-m);
    display: block;
}

.model-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.model-controls .btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--_radius-s);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--t-bright);
}

.model-controls .btn:hover {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(170, 112, 224, 0.3);
}

.model-controls .btn.active {
    background: var(--secondary);
    color: white;
}

.model-info {
    margin-top: 2rem;
    text-align: center;
}

.model-info__tags {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.model-info__description {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--t-medium);
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.9;
}

/* Loading animation for 3D viewer */
.model-viewer::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

.model-viewer.loaded::before {
    display: none;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Responsive design for 3D viewer */
@media (max-width: 768px) {
    .home-3d-model {
        display: none;
    }
    
    .model-viewer {
        height: 350px;
    }
    
    .model-showcase__title {
        font-size: 2rem;
    }
    
    .model-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .model-controls .btn {
        width: 200px;
        justify-content: center;
    }
    
    /* Ensure navigation is visible on mobile */
    .header {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 999 !important;
    }
    
    .header__navigation {
        display: flex !important;
        visibility: visible !important;
    }
    
    .menu {
        display: flex !important;
        visibility: visible !important;
    }
    
    .menu__list {
        display: flex !important;
        visibility: visible !important;
    }
}

/* Modern Loading Animations */
@keyframes modernPulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

.pulse-animation {
    animation: modernPulse 2s infinite;
}

/* Enhanced Typography */
.modern-text-gradient {
    background: linear-gradient(
        135deg,
        var(--gradient-one),
        var(--gradient-two),
        var(--gradient-three)
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

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

/* Modern Portfolio Gallery Enhancements */
.gallery__item {
    position: relative;
    overflow: hidden;
    border-radius: var(--_radius-xl);
}

.gallery__item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg,
        rgba(var(--accent), 0.1),
        rgba(var(--secondary), 0.1)
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 2;
}

.gallery__item:hover::after {
    opacity: 1;
}

.gallery__descr {
    transform: translateY(20px);
    transition: transform 0.4s ease;
    z-index: 3;
}

.gallery__item:hover .gallery__descr {
    transform: translateY(0);
}

/* Enhanced Button Styles */
.modern-btn {
    position: relative;
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--_radius-m);
    background: linear-gradient(
        135deg,
        var(--accent),
        var(--secondary)
    );
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.modern-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.6s ease;
    z-index: 1;
}

.modern-btn:hover::before {
    left: 100%;
}

.modern-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.modern-btn span {
    position: relative;
    z-index: 2;
}

/* Enhanced Form Styles */
.modern-form {
    position: relative;
}

.modern-input,
.modern-textarea {
    width: 100%;
    padding: 1.2rem;
    border: 2px solid transparent;
    border-radius: var(--_radius-s);
    background: rgba(255, 255, 255, 0.05);
    color: var(--t-bright);
    font-size: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.modern-input:focus,
.modern-textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.02);
}

.modern-input::placeholder,
.modern-textarea::placeholder {
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
}

.modern-input:focus::placeholder,
.modern-textarea:focus::placeholder {
    opacity: 0.8;
    transform: translateY(-2px);
}

/* Modern Navigation Enhancements - Removed to keep original styling */
/* Navigation styling removed to preserve original appearance */

/* Enhanced Services Cards */
.cards__card {
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
    background: linear-gradient(
        145deg,
        rgba(255, 255, 255, 0.05),
        rgba(255, 255, 255, 0.02)
    );
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cards__card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(var(--accent), 0.1),
        rgba(var(--secondary), 0.1)
    );
    opacity: 0;
    transition: opacity 0.4s ease;
}

.cards__card:hover::after {
    opacity: 1;
}

.cards__card:hover {
    transform: translateY(-10px) rotateX(5deg);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}

/* Modern Testimonials - Removed to keep original styling */
/* Testimonials styling removed to preserve original appearance */

/* Enhanced Avatar Section - Removed to keep original styling */
/* Avatar styling removed to preserve original appearance */

/* Modern Skills/Tools Section */
.tools-cards__card {
    background: linear-gradient(
        145deg,
        rgba(255, 255, 255, 0.08),
        rgba(255, 255, 255, 0.03)
    );
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.tools-cards__card::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(
        circle,
        rgba(var(--accent), 0.3),
        transparent 70%
    );
    transition: all 0.6s ease;
    transform: translate(-50%, -50%);
    border-radius: 50%;
}

.tools-cards__card:hover::before {
    width: 200px;
    height: 200px;
}

.tools-cards__card:hover {
    transform: translateY(-15px) scale(1.05);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    border-color: var(--accent);
}

.tools-cards__icon {
    transition: all 0.4s ease;
    position: relative;
    z-index: 2;
}

.tools-cards__card:hover .tools-cards__icon {
    transform: scale(1.2) rotate(10deg);
    filter: brightness(1.2);
}

/* Enhanced Scroll Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Intersection Observer Classes */
.animate-on-scroll {
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.animate-on-scroll.animate-in {
    opacity: 1;
}

.animate-fade-up {
    animation: fadeInUp 0.8s ease forwards;
}

.animate-fade-left {
    animation: fadeInLeft 0.8s ease forwards;
}

.animate-fade-right {
    animation: fadeInRight 0.8s ease forwards;
}

.animate-scale-in {
    animation: scaleIn 0.8s ease forwards;
}

/* Modern Progress Bars */
.skill-progress {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.skill-progress::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(
        90deg,
        var(--accent),
        var(--secondary)
    );
    border-radius: 4px;
    transition: width 1.5s ease;
}

.skill-progress[data-skill="95"]::before { width: 95%; }
.skill-progress[data-skill="90"]::before { width: 90%; }
.skill-progress[data-skill="85"]::before { width: 85%; }
.skill-progress[data-skill="80"]::before { width: 80%; }

/* Enhanced Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .glass-effect {
        background: rgba(0, 0, 0, 0.3);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .enhanced-card {
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }
    
    .modern-input,
    .modern-textarea {
        background: rgba(0, 0, 0, 0.2);
        border-color: rgba(255, 255, 255, 0.1);
    }
}

/* Responsive Enhancements */
@media (max-width: 768px) {
    .enhanced-card:hover {
        transform: translateY(-5px) scale(1.01);
    }
    
    .modern-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .tools-cards__card:hover {
        transform: translateY(-10px) scale(1.02);
    }
}

@media (max-width: 480px) {
    .enhanced-card:hover {
        transform: none;
    }
    
    .cards__card:hover {
        transform: translateY(-5px);
    }
}

/* Modern Preloader */
.modern-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(
        135deg,
        var(--base),
        var(--base-tint)
    );
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loader-content {
    text-align: center;
}

.loader-spinner {
    width: 80px;
    height: 80px;
    border: 4px solid rgba(var(--accent), 0.3);
    border-left: 4px solid var(--accent);
    border-radius: 50%;
    animation: modernSpin 1s linear infinite;
    margin-bottom: 2rem;
}

@keyframes modernSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-text {
    font-size: 1.2rem;
    color: var(--t-bright);
    animation: modernPulse 2s infinite;
}

/* Enhanced Floating Elements */
.floating-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
}

.floating-element {
    position: absolute;
    width: 20px;
    height: 20px;
    background: linear-gradient(
        45deg,
        var(--accent),
        var(--secondary)
    );
    border-radius: 50%;
    opacity: 0.1;
    animation: float 20s infinite linear;
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.1;
    }
    90% {
        opacity: 0.1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

.floating-element:nth-child(1) { left: 10%; animation-delay: 0s; }
.floating-element:nth-child(2) { left: 20%; animation-delay: 2s; }
.floating-element:nth-child(3) { left: 30%; animation-delay: 4s; }
.floating-element:nth-child(4) { left: 40%; animation-delay: 6s; }
.floating-element:nth-child(5) { left: 50%; animation-delay: 8s; }
.floating-element:nth-child(6) { left: 60%; animation-delay: 10s; }
.floating-element:nth-child(7) { left: 70%; animation-delay: 12s; }
.floating-element:nth-child(8) { left: 80%; animation-delay: 14s; }
.floating-element:nth-child(9) { left: 90%; animation-delay: 16s; }

/* Modern Cursor Effects */
.custom-cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    background: var(--accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.1s ease;
    opacity: 0.7;
}

.custom-cursor.clicked {
    transform: scale(1.5);
    opacity: 1;
}

/* Performance Optimizations */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

.gpu-accelerated {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .enhanced-card {
        border: 2px solid var(--t-bright);
    }
    
    .modern-btn {
        border: 2px solid var(--t-bright);
    }
    
    .glass-effect {
        background: var(--base);
        border: 2px solid var(--t-bright);
    }
}

/* Print Styles */
@media print {
    .enhanced-card,
    .cards__card,
    .testimonials-card {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .modern-text-gradient {
        -webkit-text-fill-color: initial;
        color: #000;
    }
}
