/* Custom Styles for DesignCraft */

/* Reset para menú móvil */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Logo styles */
.logo {
    transition: all 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #2563eb;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1e40af;
}

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

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

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

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

/* Utility classes for animations */
.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out;
}

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

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

.animate-pulse-slow {
    animation: pulse 3s infinite;
}

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

/* Hero section enhancements */
.hero-content {
    animation: fadeInLeft 1s ease-out;
}

.hero-image {
    animation: fadeInRight 1s ease-out 0.2s both;
}

/* Service cards hover effects */
.service-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Portfolio filter buttons */
.portfolio-filter {
    transition: all 0.3s ease;
    color: #6b7280;
}

.portfolio-filter.active {
    background-color: #2563eb;
    color: white;
}

.portfolio-filter:hover {
    color: #2563eb;
}

/* Portfolio items */
.portfolio-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.3);
}

/* Navbar scroll effects */
.navbar-scrolled {
    background-color: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

/* Simple Mobile Menu */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(95, 31, 132, 0.95);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
}

.mobile-menu-overlay.show {
    display: flex;
}

.mobile-menu-content {
    position: relative;
    text-align: center;
    padding: 60px 20px 40px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    min-height: 100vh;
}

.mobile-close-btn {
    position: fixed;
    top: 30px;
    right: 30px;
    background: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 26px;
    color: #5F1F84;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    z-index: 10001;
}

.mobile-close-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 30px;
    align-items: center;
}

.mobile-nav-link {
    color: white;
    text-decoration: none;
    font-size: 24px;
    font-weight: 500;
    padding: 15px 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    transition: all 0.3s ease;
    display: block;
    min-width: 200px;
}

.mobile-nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Back to top button */
#back-to-top {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#back-to-top.show {
    transform: translateY(0);
    opacity: 1;
}

/* Form styles */
select option {
    background-color: #1e293b;
    color: white;
}

/* Loading animation */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading {
    animation: spin 1s linear infinite;
}

/* Parallax effect */
.parallax {
    transform: translateZ(0);
    will-change: transform;
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, #F97B1C, #5F1F84);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Custom button hover effects */
.btn-hover-effect {
    position: relative;
    overflow: hidden;
}

.btn-hover-effect::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;
}

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

/* Section reveal animation */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Typewriter effect */
.typewriter {
    overflow: hidden;
    border-right: 3px solid #F97B1C;
    white-space: nowrap;
    margin: 0 auto;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: #F97B1C }
}

/* Responsive typography */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
        line-height: 1.2;
        margin-top: 4rem; /* Más espacio arriba del titular en móvil */
    }
    
    /* Ajuste del titular del bloque de contacto para caber en 4 líneas */
    h2.contact-title {
        font-size: clamp(3rem, 7.6vw, 2.2rem);
        line-height: 1.15;
    }
    
    /* Asegurar que el navbar no se desborde del 100% de la pantalla */
    #navbar {
        width: 100%;
        max-width: 100vw;
        overflow: hidden;
    }
    
    #navbar > div {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }
    
    #navbar .flex {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }
    
    /* Asegurar que el botón del menú hamburguesa esté siempre visible */
    #mobile-menu-btn {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }
    
    /* Asegurar que el logo no crezca demasiado en móvil */
    .logo {
        max-height: 5rem;
        max-width: 250px;
        object-fit: contain;
    }
    
    /* Asegurar que el contenedor del logo no se desborde */
    .logo-container {
        flex-shrink: 1;
        min-width: 0;
        overflow: hidden;
    }
    
    /* Responsive adjustments for mobile menu */
    .mobile-nav-link {
        font-size: 20px;
        padding: 12px 20px;
        min-width: 180px;
    }
    
    .mobile-close-btn {
        width: 40px;
        height: 40px;
        font-size: 22px;
        top: 20px;
        right: 20px;
        position: fixed;
        z-index: 10001;
    }
    
    .mobile-menu-content {
        padding: 50px 15px 30px 15px;
    }
}

/* Ajuste de espacio bajo el navbar fijo en pantallas ~tablet (evita solapamiento a ~900px) */
@media (min-width: 768px) and (max-width: 1024px) {
    #inicio {
        padding-top: 10rem; /* compensa altura del navbar cuando muestra menú y CTA */
    }
}

/* Mobile Footer Styles */
@media (max-width: 768px) {
    .footer-mobile {
        display: block;
    }
    
    .footer-desktop {
        display: none;
    }
    
    .footer-mobile-nav {
        text-align: center;
        margin-bottom: 30px;
        padding-bottom: 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .footer-mobile-nav ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px;
        list-style: none;
        padding: 0;
        margin: 0;
    }
    
    .footer-mobile-nav a {
        color: #d1d5db;
        text-decoration: none;
        font-size: 14px;
        transition: color 0.3s ease;
    }
    
    .footer-mobile-nav a:hover {
        color: white;
    }
    
    .footer-mobile-brand {
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .footer-mobile-brand img {
        width: 50px;
        height: 50px;
    }
    
    .footer-mobile-brand p {
        color: #9ca3af;
        font-size: 12px;
        margin: 0;
    }
    
    .footer-mobile-copyright {
        color: #9ca3af;
        font-size: 11px;
        margin-top: 10px;
    }
}

@media (min-width: 769px) {
    .footer-mobile {
        display: none;
    }
    
    .footer-desktop {
        display: block;
    }
}

/* Custom focus styles */
*:focus {
    outline: 2px solid #F97B1C;
    outline-offset: 2px;
}

/* Image lazy loading */
img {
    transition: opacity 0.3s;
}

img.lazy {
    opacity: 0;
}

img.lazy.loaded {
    opacity: 1;
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles if needed */
}