/* OpenAI-inspired Dark Professional Design for CasaNoor */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #000000;
    min-height: 100vh;
    color: #ffffff;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* Native app adjustments */
.native-app #home { padding-top: calc(80px + env(safe-area-inset-top)); }
.native-app #app { display: none !important; }
.native-app a[href="#app"] { display: none !important; }

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.025em;
    color: #ffffff;
}

/* Navigation */
nav {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
    padding: 8px 12px;
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(10px + env(safe-area-inset-bottom));
    top: auto;
    z-index: 50;
    width: auto;
    max-width: none;
    right: auto;
}

/* Hero Section */
#home {
    background: linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.55)), url("/assets/gallery/hero.jpeg") center/cover no-repeat;
    position: relative;
    overflow: hidden;
}

#home::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 40%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(168, 85, 247, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

/* Upload Area */
#upload-area {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: all 0.3s ease;
    color: #9ca3af;
    position: relative;
}

#upload-area:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Textarea styling */
textarea {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #d1d5db;
    transition: all 0.3s ease;
}

textarea:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.5);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    color: #9ca3af;
}

textarea::placeholder {
    color: #9ca3af;
}

/* Form Elements */
select, input[type="text"], input[type="email"] {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    color: #ffffff;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

select:focus, input:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.5);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Radio buttons */
input[type="radio"] {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    margin-right: 8px;
    position: relative;
    transition: all 0.3s ease;
    background: transparent;
}

input[type="radio"]:checked {
    border-color: rgba(99, 102, 241, 0.8);
    background: rgba(99, 102, 241, 0.1);
}

input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 8px;
    height: 8px;
    background: rgba(99, 102, 241, 0.9);
    border-radius: 50%;
}

/* Buttons */
button {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-weight: 500;
    color: white;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

button:hover:not(:disabled) {
    background: linear-gradient(135deg, #5855eb, #9333ea);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

button:hover:not(:disabled)::before {
    left: 100%;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Sections */
section:not(#home) {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Demo Section */
#demo {
    background: linear-gradient(135deg, #0a0a0a 0%, #000000 50%, #0a0a0a 100%);
}

/* Testimonials */
.testimonial-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.testimonial-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-4px);
}

/* Design cards */
.design-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease-out forwards;
    position: relative;
    overflow: hidden;
}

.design-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transition: left 0.5s;
}

.design-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading animation */
.loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Text colors */
.text-gray-600 {
    color: #9ca3af;
}

.text-gray-500 {
    color: #9ca3af;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Utility classes */
.glass-effect {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dark-gradient {
    background: linear-gradient(135deg, #000000 0%, #0a0a0a 50%, #000000 100%);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
    opacity: 0;
}

/* Interactive 3D Styles */
.interactive-3d-container {
    transition: all 0.3s ease;
    position: relative;
}

.interactive-3d-image {
    transition: transform 0.3s ease-out;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.interactive-3d-container:hover {
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.3);
}

.control-btn {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
    font-size: 16px;
    line-height: 1;
}

.control-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.control-btn:active {
    transform: scale(0.95);
}

/* Fullscreen styles */
.interactive-3d-container:fullscreen {
    background: #000;
}

.interactive-3d-container:fullscreen .interactive-3d-image {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
}

/* Features Section Animations */
@keyframes tilt {
    0%, 50%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(0.5deg);
    }
    75% {
        transform: rotate(-0.5deg);
    }
}

@keyframes bounce-subtle {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-3px);
    }
    60% {
        transform: translateY(-1px);
    }
}

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

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

.animate-tilt {
    animation: tilt 10s ease-in-out infinite;
}

.animate-bounce-subtle {
    animation: bounce-subtle 2s ease-in-out infinite;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-gradient {
    background-size: 200% 200%;
    animation: gradient-shift 3s ease infinite;
}

/* Enhanced Features Section */
.features-section {
    position: relative;
    overflow: hidden;
}

.features-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.feature-card-glow {
    position: relative;
}

.feature-card-glow::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: linear-gradient(45deg,
        rgba(99, 102, 241, 0.5),
        rgba(168, 85, 247, 0.5),
        rgba(236, 72, 153, 0.5),
        rgba(99, 102, 241, 0.5)
    );
    background-size: 400% 400%;
    animation: gradient-shift 4s ease infinite;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.feature-card-glow:hover::before {
    opacity: 1;
}

/* Staggered animation for feature cards */
.feature-card:nth-child(1) {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.feature-card:nth-child(2) {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.feature-card:nth-child(3) {
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

/* Enhanced hover effects */
.feature-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 60px rgba(99, 102, 241, 0.2);
}

/* Icon animations */
.feature-icon {
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.feature-card:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.3));
}

/* Text gradient animations */
.gradient-text {
    background: linear-gradient(45deg,
        #6366f1,
        #a855f7,
        #ec4899,
        #f59e0b,
        #10b981
    );
    background-size: 400% 400%;
    animation: gradient-shift 3s ease infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Dropdown Arrow Rotation */
.rotate-180 {
    transform: rotate(180deg);
}

/* Enhanced Shadow for Hover Effects */
.shadow-3xl {
    box-shadow: 0 35px 60px -12px rgba(0, 0, 0, 0.25);
}

/* Perfect Image Centering */
.image-container {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    height: 100% !important;
}

.image-container img {
    display: block !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    margin: 0 auto !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    nav {
        margin: 0 10px;
    }

    #home {
        padding-top: 120px;
        padding-bottom: 60px;
    }

    .control-btn {
        padding: 6px;
        font-size: 14px;
    }

    .feature-card {
        transform: none !important;
    }

    .feature-card:hover {
        transform: scale(1.01) !important;
    }
}

/* Style Selector Cards */
.style-card {
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(75, 85, 99, 0.4);
}

.style-card:hover {
    background-color: rgba(55, 65, 81, 0.8);
    transform: translateY(-2px);
    border-color: rgba(96, 165, 250, 0.5);
}

.style-card.selected {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(147, 51, 234, 0.2));
    border-color: #60A5FA;
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.3);
}

.style-card.selected .check-icon {
    opacity: 1;
    transform: scale(1);
}

/* Custom Scrollbar for Style Grid */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(31, 41, 55, 0.5);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(75, 85, 99, 0.8);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(107, 114, 128, 1);
}

/* Loading Overlay Animations */
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fade-in-up 0.5s ease-out forwards;
}

/* Typing Cursor */
.cursor-blink {
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Before/After Comparison Slider */
.comparison-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.comparison-image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.comparison-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.comparison-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    opacity: 0;
    cursor: ew-resize;
    margin: 0;
}

.slider-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 4px;
    background: white;
    z-index: 10;
    pointer-events: none;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.slider-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    color: #333;
    font-size: 14px;
}

.comparison-label {
    position: absolute;
    top: 1rem;
    padding: 0.25rem 0.75rem;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    pointer-events: none;
    z-index: 15;
    backdrop-filter: blur(4px);
}

.label-before { left: 1rem; }
.label-after { right: 1rem; }
