/*
 * VibeWear AI - 3D Effects Stylesheet
 * ===================================
 * Advanced 3D transformations and depth effects
 */

/* 3D Card Container */
.card-3d-container {
    perspective: 1000px;
    transform-style: preserve-3d;
}

/* 3D Card */
.card-3d {
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    will-change: transform;
}

.card-3d:hover {
    transform: translateZ(20px) rotateX(5deg) rotateY(5deg);
}

.card-3d-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.card-3d.flipped .card-3d-inner {
    transform: rotateY(180deg);
}

.card-3d-front,
.card-3d-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.card-3d-back {
    transform: rotateY(180deg);
}

/* Floating Card Effect */
.card-float {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) translateZ(0);
    }
    50% {
        transform: translateY(-20px) translateZ(30px);
    }
}

.card-float-delay-1 {
    animation-delay: -1.5s;
}

.card-float-delay-2 {
    animation-delay: -3s;
}

.card-float-delay-3 {
    animation-delay: -4.5s;
}

/* Tilt Effect */
.tilt-card {
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
}

.tilt-card .tilt-content {
    transform: translateZ(50px);
}

.tilt-card .tilt-shadow {
    position: absolute;
    inset: 0;
    background: var(--color-accent);
    opacity: 0;
    filter: blur(40px);
    transform: translateZ(-50px);
    transition: opacity 0.3s ease;
    border-radius: inherit;
}

.tilt-card:hover .tilt-shadow {
    opacity: 0.15;
}

/* Glass Card with 3D Depth */
.glass-card-3d {
    background: rgba(241, 233, 233, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(228, 145, 201, 0.3);
    border-radius: var(--radius-lg);
    box-shadow: 
        0 8px 32px rgba(21, 23, 61, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform-style: preserve-3d;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.glass-card-3d::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(228, 145, 201, 0.15) 0%,
        transparent 50%,
        rgba(21, 23, 61, 0.08) 100%
    );
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.glass-card-3d:hover {
    transform: translateY(-10px) translateZ(30px);
    box-shadow: 
        0 20px 60px rgba(21, 23, 61, 0.2),
        0 0 40px rgba(228, 145, 201, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.glass-card-3d:hover::before {
    opacity: 1;
}

/* 3D Button */
.btn-3d {
    position: relative;
    transform-style: preserve-3d;
    transition: all 0.3s ease;
}

.btn-3d::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-primary);
    border-radius: inherit;
    transform: translateZ(-10px);
    filter: blur(15px);
    opacity: 0.5;
    transition: all 0.3s ease;
}

.btn-3d:hover {
    transform: translateY(-3px) translateZ(10px);
}

.btn-3d:hover::before {
    opacity: 0.8;
    transform: translateZ(-15px);
}

.btn-3d:active {
    transform: translateY(-1px) translateZ(5px);
}

/* Parallax Container */
.parallax-container {
    perspective: 1000px;
    overflow: hidden;
}

.parallax-layer {
    transform-style: preserve-3d;
    will-change: transform;
}

.parallax-layer-back {
    transform: translateZ(-100px) scale(1.1);
}

.parallax-layer-mid {
    transform: translateZ(-50px) scale(1.05);
}

.parallax-layer-front {
    transform: translateZ(0);
}

/* 3D Icon */
.icon-3d {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    font-size: 1.5rem;
    transform-style: preserve-3d;
    transition: all 0.4s ease;
    box-shadow: 
        0 10px 30px rgba(21, 23, 61, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.icon-3d::before {
    content: '';
    position: absolute;
    inset: 0;
    background: inherit;
    border-radius: inherit;
    transform: translateZ(-10px);
    filter: blur(10px);
    opacity: 0.5;
}

.icon-3d:hover {
    transform: rotateY(15deg) rotateX(15deg) translateZ(20px);
}

/* 3D Stats Card */
.stat-card-3d {
    position: relative;
    padding: var(--space-xl);
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    text-align: center;
    transform-style: preserve-3d;
    transition: all 0.4s ease;
}

.stat-card-3d::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 10%;
    width: 80%;
    height: 20px;
    background: inherit;
    border-radius: 50%;
    filter: blur(20px);
    opacity: 0.3;
    transform: rotateX(80deg);
    transition: all 0.4s ease;
}

.stat-card-3d:hover {
    transform: translateY(-15px) translateZ(40px);
}

.stat-card-3d:hover::after {
    opacity: 0.5;
    bottom: -15px;
}

.stat-number {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transform: translateZ(30px);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transform: translateZ(20px);
}

/* 3D Clothing Item Card */
.clothing-card-3d {
    position: relative;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transform-style: preserve-3d;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.clothing-card-3d:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 
        0 30px 60px rgba(21, 23, 61, 0.2),
        0 0 40px rgba(228, 145, 201, 0.25);
}

.clothing-card-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.clothing-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.clothing-card-3d:hover .clothing-card-image img {
    transform: scale(1.1);
}

.clothing-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(15, 10, 26, 0.9) 0%,
        transparent 50%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
}

.clothing-card-3d:hover .clothing-card-overlay {
    opacity: 1;
}

.clothing-card-actions {
    position: absolute;
    bottom: var(--space-md);
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    display: flex;
    gap: var(--space-sm);
    opacity: 0;
    transition: all 0.3s ease;
}

.clothing-card-3d:hover .clothing-card-actions {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.clothing-card-content {
    padding: var(--space-md);
    transform: translateZ(20px);
}

/* 3D Outfit Card */
.outfit-card-3d {
    position: relative;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transform-style: preserve-3d;
    transition: all 0.5s ease;
}

.outfit-card-3d:hover {
    transform: translateY(-10px) rotateX(5deg);
    border-color: var(--border-glow);
}

.outfit-items-3d {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    transform: translateZ(30px);
}

.outfit-item-thumb {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid var(--border-glass);
    transition: all 0.3s ease;
}

.outfit-item-thumb:hover {
    transform: translateZ(20px) scale(1.1);
    border-color: var(--primary-light);
}

.outfit-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 3D Hero Section */
.hero-3d {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
    overflow: hidden;
}

.hero-3d-content {
    position: relative;
    z-index: 2;
    text-align: center;
    transform-style: preserve-3d;
}

.hero-3d-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 10vw, 6rem);
    font-weight: 800;
    line-height: 1.1;
    transform: translateZ(100px);
}

.hero-3d-subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-top: var(--space-lg);
    transform: translateZ(50px);
}

.hero-3d-cta {
    margin-top: var(--space-2xl);
    transform: translateZ(75px);
}

.hero-3d-shapes {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.shape-3d {
    position: absolute;
    transform-style: preserve-3d;
    animation: shape-float 10s ease-in-out infinite;
}

.shape-3d-1 {
    width: 300px;
    height: 300px;
    background: var(--gradient-primary);
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape-3d-2 {
    width: 200px;
    height: 200px;
    background: var(--gradient-secondary);
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.2;
    top: 60%;
    right: 15%;
    animation-delay: -3s;
}

.shape-3d-3 {
    width: 150px;
    height: 150px;
    background: var(--gradient-accent);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    filter: blur(50px);
    opacity: 0.25;
    bottom: 20%;
    left: 30%;
    animation-delay: -6s;
}

@keyframes shape-float {
    0%, 100% {
        transform: translateY(0) rotate(0deg) translateZ(0);
    }
    33% {
        transform: translateY(-30px) rotate(120deg) translateZ(50px);
    }
    66% {
        transform: translateY(20px) rotate(240deg) translateZ(-30px);
    }
}

/* 3D Feature Cards */
.feature-card-3d {
    position: relative;
    padding: var(--space-xl);
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    transform-style: preserve-3d;
    transition: all 0.5s ease;
}

.feature-card-3d::before {
    content: '';
    position: absolute;
    inset: -1px;
    background: var(--gradient-primary);
    border-radius: inherit;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.feature-card-3d:hover {
    transform: translateY(-20px) translateZ(50px);
}

.feature-card-3d:hover::before {
    opacity: 0.3;
    filter: blur(20px);
}

.feature-icon-3d {
    width: 70px;
    height: 70px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: var(--space-lg);
    transform: translateZ(40px);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.3);
}

.feature-title-3d {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    transform: translateZ(30px);
}

.feature-desc-3d {
    color: var(--text-secondary);
    transform: translateZ(20px);
}

/* 3D Modal */
.modal-3d {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.modal-3d.active {
    opacity: 1;
    visibility: visible;
}

.modal-3d-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
}

.modal-3d-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    transform: perspective(1000px) rotateX(-30deg) translateZ(-100px);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    overflow-y: auto;
}

.modal-3d.active .modal-3d-content {
    transform: perspective(1000px) rotateX(0) translateZ(0);
    opacity: 1;
}

/* 3D Form Input Focus */
.input-3d {
    position: relative;
    transform-style: preserve-3d;
}

.input-3d:focus-within {
    transform: translateZ(10px);
}

.input-3d .form-input {
    transition: all 0.3s ease;
}

.input-3d:focus-within .form-input {
    box-shadow: 
        0 0 0 3px rgba(139, 92, 246, 0.2),
        0 10px 30px rgba(139, 92, 246, 0.1);
}

/* 3D Badge */
.badge-3d {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-md);
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transform: translateZ(10px);
    box-shadow: 0 4px 15px rgba(21, 23, 61, 0.2);
}

/* 3D Weather Widget */
.weather-widget-3d {
    position: relative;
    padding: var(--space-lg);
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    transform-style: preserve-3d;
    transition: all 0.4s ease;
}

.weather-widget-3d:hover {
    transform: translateY(-5px) translateZ(30px);
}

.weather-icon-3d {
    font-size: 3rem;
    transform: translateZ(40px);
    animation: weather-bounce 2s ease-in-out infinite;
}

@keyframes weather-bounce {
    0%, 100% { transform: translateZ(40px) translateY(0); }
    50% { transform: translateZ(40px) translateY(-10px); }
}

.weather-temp-3d {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    transform: translateZ(30px);
}

/* Responsive 3D Adjustments */
@media (max-width: 768px) {
    .card-3d:hover {
        transform: translateZ(10px) rotateX(2deg) rotateY(2deg);
    }
    
    .glass-card-3d:hover {
        transform: translateY(-5px) translateZ(15px);
    }
    
    .stat-card-3d:hover {
        transform: translateY(-8px) translateZ(20px);
    }
    
    .hero-3d-title {
        transform: translateZ(50px);
    }
    
    .shape-3d {
        display: none;
    }
}