/* ===========================================
   CUSTOM STYLES - Maker Portfolio
   Estilo Industrial High-Tech
   =========================================== */

/* Variables CSS para consistencia */
:root {
    --studio-bg: #FAF9F6;
    --studio-text: #2D2926;
    --accent-design: #7B9C8C;
    --accent-warm: #C17D5E;
    --accent-soft: #D4C9B9;
    --graphite-light: #E5E7EB;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Custom Scrollbar - Dark Theme */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--studio-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--graphite);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-design);
}

/* Body Reset */
body {
    overflow-x: hidden;
    line-height: 1.6;
}

/* Animated Background Grid for Hero */
.grid-background {
    background-image: 
        linear-gradient(rgba(123, 156, 140, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(123, 156, 140, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: grid-animation 20s linear infinite;
}

@keyframes grid-animation {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(50px, 50px);
    }
}

/* CTA Button Effects */
.cta-button {
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(123, 156, 140, 0.3);
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.cta-button:hover::before {
    width: 300px;
    height: 300px;
}

/* Secondary Button Glow Effect */
.cta-button-secondary {
    position: relative;
    box-shadow: 0 0 20px rgba(123, 156, 140, 0.2);
}

.cta-button-secondary:hover {
    box-shadow: 0 0 30px rgba(123, 156, 140, 0.5);
}

/* Expertise Cards Hover Effect */
.expertise-card {
    position: relative;
    transition: var(--transition-smooth);
}

.expertise-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(123, 156, 140, 0.1) 100%);
    opacity: 0;
    transition: var(--transition-smooth);
    border-radius: 0.5rem;
}

.expertise-card:hover::before {
    opacity: 1;
}

/* Process Step Animation */
.process-step {
    opacity: 0;
    transform: translateX(-30px);
    animation: slideInLeft 0.6s ease-out forwards;
}

.process-step:nth-child(1) {
    animation-delay: 0.1s;
}

.process-step:nth-child(2) {
    animation-delay: 0.2s;
}

.process-step:nth-child(3) {
    animation-delay: 0.3s;
}

.process-step:nth-child(4) {
    animation-delay: 0.4s;
}

@keyframes slideInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Process Number Glow */
.process-number {
    box-shadow: 0 0 20px rgba(123, 156, 140, 0.4);
    transition: var(--transition-smooth);
}

.process-step:hover .process-number {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(123, 156, 140, 0.6);
}

/* Tech Badge */
.tech-badge {
    /* Hover effect removed */
}

/* Project Card Animation */
.project-card {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease-out forwards;
}

.project-card:nth-child(1) { animation-delay: 0.1s; }
.project-card:nth-child(2) { animation-delay: 0.2s; }
.project-card:nth-child(3) { animation-delay: 0.3s; }
.project-card:nth-child(4) { animation-delay: 0.4s; }
.project-card:nth-child(5) { animation-delay: 0.5s; }
.project-card:nth-child(6) { animation-delay: 0.6s; }

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

/* Project Card Image */
.project-card img {
    transition: transform 0.5s ease;
}


/* Filter Button Active State */
.filter-btn {
    transition: var(--transition-smooth);
}

.filter-btn.active {
    background: var(--accent-design);
    color: white;
    border-color: var(--accent-design);
}

.filter-btn:not(.active):hover {
    background: white;
    border-color: var(--accent-design);
}

/* Form Input Focus Effects */
input:focus,
textarea:focus,
select:focus {
    box-shadow: 0 0 0 3px rgba(123, 156, 140, 0.2);
}

/* Loading Animation for Form Submission */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

/* Section Fade In on Scroll */
section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Glowing Text Effect for Headings */
h1, h2 {
    text-shadow: 0 0 20px rgba(123, 156, 140, 0.1);
}

/* Navigation Link Underline Effect */
nav a {
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-design);
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 100%;
}

/* WhatsApp Button Pulse Animation */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

.fixed a[href*="whatsapp"] {
    animation: pulse 2s infinite;
}

/* Responsive Typography Adjustments */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    .expertise-card,
    .process-step {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* Print Styles */
@media print {
    .fixed,
    nav,
    footer {
        display: none;
    }
    
    section {
        page-break-inside: avoid;
    }
}

/* 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;
    }
}

/* Selection Color */
::selection {
    background: var(--accent-design);
    color: white;
}

::-moz-selection {
    background: var(--accent-design);
    color: white;
}

/* Focus Visible for Keyboard Navigation */
*:focus-visible {
    outline: 2px solid var(--accent-design);
    outline-offset: 2px;
}

/* Tooltip Style (if needed) */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 8px 12px;
    background: var(--studio-bg);
    border: 1px solid var(--accent-design);
    border-radius: 4px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

[data-tooltip]:hover::after {
    opacity: 1;
}

/* Code Block Styling */
code {
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

/* Subtle Grid Pattern for Dark Sections */
.bg-dark-primary,
.bg-dark-secondary {
    position: relative;
}

/* Loading State for Images */
img[data-loading] {
    background: linear-gradient(
        90deg,
        var(--graphite) 25%,
        var(--dark-secondary) 50%,
        var(--graphite) 75%
    );
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}
