/* =====================================================
   STYLES.CSS - Hibrusi Portfolio
   Estilos personalizados con soporte Light/Dark Mode
   ===================================================== */

/* =====================================================
   CSS CUSTOM PROPERTIES
   ===================================================== */
:root {
    /* Warm Colors */
    --warm-400: #ed9242;
    --warm-500: #e8751d;
    --warm-600: #d95a13;
    
    /* Transitions */
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* =====================================================
   BASE STYLES
   ===================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    overflow-x: hidden;
}

/* Selection */
::selection {
    background-color: rgba(232, 117, 29, 0.25);
    color: inherit;
}

.dark ::selection {
    background-color: rgba(237, 146, 66, 0.35);
}

/* =====================================================
   TYPOGRAPHY
   ===================================================== */
.text-gradient {
    background: linear-gradient(135deg, var(--warm-400) 0%, var(--warm-600) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* =====================================================
   DECORATIVE BACKGROUNDS
   ===================================================== */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    animation: blobFloat 20s ease-in-out infinite;
}

/* Light Mode Blobs */
.blob-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(237, 146, 66, 0.08) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    animation-delay: 0s;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(217, 90, 19, 0.06) 0%, transparent 70%);
    bottom: 20%;
    left: -150px;
    animation-delay: -10s;
}

/* Dark Mode Blobs */
.dark .blob-1 {
    background: radial-gradient(circle, rgba(237, 146, 66, 0.15) 0%, transparent 70%);
}

.dark .blob-2 {
    background: radial-gradient(circle, rgba(217, 90, 19, 0.1) 0%, transparent 70%);
}

@keyframes blobFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(30px, -30px) scale(1.05);
    }
    50% {
        transform: translate(-20px, 20px) scale(0.95);
    }
    75% {
        transform: translate(20px, 10px) scale(1.02);
    }
}

/* Noise Overlay */
.noise-overlay {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.02;
    pointer-events: none;
}

.dark .noise-overlay {
    opacity: 0.03;
}

/* =====================================================
   HEADER & NAVIGATION
   ===================================================== */
#header {
    background: transparent;
}

#header.scrolled {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.dark #header.scrolled {
    background: rgba(13, 18, 25, 0.85);
    border-bottom-color: rgba(51, 65, 85, 0.3);
    box-shadow: none;
}

/* Navigation Links */
.nav-link {
    position: relative;
    color: #64748b;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    transition: color 0.3s var(--transition-smooth);
}

.dark .nav-link {
    color: #94a3b8;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--warm-400), var(--warm-600));
    transition: width 0.3s var(--transition-smooth);
}

.nav-link:hover {
    color: #1e293b;
}

.dark .nav-link:hover {
    color: #f1f5f9;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Mobile Menu */
.mobile-menu {
    max-height: 0;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    transition: max-height 0.4s var(--transition-smooth);
}

.dark .mobile-menu {
    background: rgba(13, 18, 25, 0.95);
}

.mobile-menu.open {
    max-height: 400px;
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--warm-500) 0%, var(--warm-600) 100%);
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s var(--transition-smooth);
    box-shadow: 0 4px 15px rgba(232, 117, 29, 0.25);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--warm-400) 0%, var(--warm-500) 100%);
    opacity: 0;
    transition: opacity 0.3s var(--transition-smooth);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(232, 117, 29, 0.35);
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-primary > * {
    position: relative;
    z-index: 1;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: #475569;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 0.75rem;
    border: 2px solid rgba(148, 163, 184, 0.4);
    cursor: pointer;
    transition: all 0.3s var(--transition-smooth);
}

.dark .btn-secondary {
    color: #e2e8f0;
    border-color: rgba(100, 116, 139, 0.4);
}

.btn-secondary:hover {
    border-color: var(--warm-500);
    color: var(--warm-500);
    background: rgba(232, 117, 29, 0.05);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* =====================================================
   SERVICE CARDS
   ===================================================== */
.service-card {
    position: relative;
    padding: 2rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.4) 100%);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 1.25rem;
    transition: all 0.4s var(--transition-smooth);
    overflow: hidden;
}

.dark .service-card {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.4) 0%, rgba(30, 41, 59, 0.2) 100%);
    border-color: rgba(51, 65, 85, 0.5);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--warm-400), var(--warm-600));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s var(--transition-smooth);
}

.service-card:hover {
    transform: translateY(-8px);
    border-color: rgba(232, 117, 29, 0.3);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.7) 100%);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.dark .service-card:hover {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.6) 0%, rgba(30, 41, 59, 0.3) 100%);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-icon {
    width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(232, 117, 29, 0.1) 0%, rgba(217, 90, 19, 0.05) 100%);
    border-radius: 0.875rem;
    color: var(--warm-500);
    margin-bottom: 1.25rem;
    transition: all 0.3s var(--transition-smooth);
}

.dark .service-icon {
    background: linear-gradient(135deg, rgba(237, 146, 66, 0.15) 0%, rgba(217, 90, 19, 0.1) 100%);
    color: var(--warm-400);
}

.service-card:hover .service-icon {
    background: linear-gradient(135deg, rgba(232, 117, 29, 0.2) 0%, rgba(217, 90, 19, 0.1) 100%);
    transform: scale(1.1);
}

/* =====================================================
   HERO VISUAL ELEMENTS
   ===================================================== */
.hero-card {
    transform: perspective(1000px) rotateY(-5deg) rotateX(5deg);
    transition: transform 0.5s var(--transition-smooth);
}

.hero-card:hover {
    transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
}

/* Code Animation */
.code-line {
    opacity: 0;
    animation: fadeInCode 0.5s var(--transition-smooth) forwards;
}

.code-line:nth-child(1) { animation-delay: 0.5s; }
.code-line:nth-child(2) { animation-delay: 0.7s; }
.code-line:nth-child(3) { animation-delay: 0.9s; }
.code-line:nth-child(4) { animation-delay: 1.1s; }
.code-line:nth-child(5) { animation-delay: 1.3s; }
.code-line:nth-child(6) { animation-delay: 1.5s; }

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

/* Floating Animation */
.floating {
    animation: float 6s ease-in-out infinite;
}

.floating.delay-300 {
    animation-delay: -2s;
}

.floating.delay-500 {
    animation-delay: -3s;
}

.floating.delay-700 {
    animation-delay: -4s;
}

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

/* =====================================================
   FORM STYLES
   ===================================================== */
.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(248, 250, 252, 0.8);
    border: 1px solid rgba(203, 213, 225, 0.8);
    border-radius: 0.75rem;
    color: #1e293b;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s var(--transition-smooth);
}

.dark .form-input {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(51, 65, 85, 0.5);
    color: #f1f5f9;
}

.form-input::placeholder {
    color: #94a3b8;
}

.dark .form-input::placeholder {
    color: #64748b;
}

.form-input:focus {
    outline: none;
    border-color: var(--warm-500);
    background: white;
    box-shadow: 0 0 0 3px rgba(232, 117, 29, 0.1);
}

.dark .form-input:focus {
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 3px rgba(237, 146, 66, 0.15);
}

.form-input:hover:not(:focus) {
    border-color: rgba(148, 163, 184, 0.8);
}

.dark .form-input:hover:not(:focus) {
    border-color: rgba(100, 116, 139, 0.7);
}

/* Form Feedback States */
#form-feedback.success #feedback-content {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #16a34a;
}

.dark #form-feedback.success #feedback-content {
    color: #4ade80;
}

#form-feedback.error #feedback-content {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #dc2626;
}

.dark #form-feedback.error #feedback-content {
    color: #f87171;
}

/* =====================================================
   REVEAL ANIMATIONS
   ===================================================== */
.reveal-up {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s var(--transition-smooth);
}

.reveal-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-up.delay-100 { transition-delay: 0.1s; }
.reveal-up.delay-200 { transition-delay: 0.2s; }
.reveal-up.delay-300 { transition-delay: 0.3s; }

/* =====================================================
   THEME TOGGLE ANIMATION
   ===================================================== */
#theme-toggle {
    position: relative;
    overflow: hidden;
}

#theme-toggle svg {
    transition: transform 0.3s var(--transition-smooth);
}

#theme-toggle:hover svg {
    transform: rotate(15deg) scale(1.1);
}

/* =====================================================
   SCROLLBAR
   ===================================================== */
::-webkit-scrollbar {
    width: 10px;
}

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

.dark ::-webkit-scrollbar-track {
    background: #0d1219;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 5px;
}

.dark ::-webkit-scrollbar-thumb {
    background: #334155;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* =====================================================
   RESPONSIVE ADJUSTMENTS
   ===================================================== */
@media (max-width: 768px) {
    .blob-1 {
        width: 400px;
        height: 400px;
        top: -100px;
        right: -100px;
    }
    
    .blob-2 {
        width: 300px;
        height: 300px;
    }
    
    .hero-card {
        transform: none;
    }
    
    .hero-card:hover {
        transform: none;
    }
    
    .service-card:hover {
        transform: translateY(-4px);
    }
}

@media (max-width: 640px) {
    .btn-lg {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }
}

/* =====================================================
   ACCESSIBILITY - REDUCED MOTION
   ===================================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
    
    .reveal-up {
        opacity: 1;
        transform: none;
    }
    
    .hero-card {
        transform: none;
    }
}

/* =====================================================
   FOCUS VISIBLE - ACCESSIBILITY
   ===================================================== */
:focus-visible {
    outline: 2px solid var(--warm-500);
    outline-offset: 2px;
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible),
input:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) {
    outline: none;
}

/* =====================================================
   PRINT STYLES
   ===================================================== */
@media print {
    .blob,
    .noise-overlay,
    #header,
    #theme-toggle,
    #mobile-menu-btn,
    .floating {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .reveal-up {
        opacity: 1 !important;
        transform: none !important;
    }
}
