/*
Theme Name: AM Portfolio
Description: Professional portfolio theme for Alex Mancía - Cybersecurity & Web Development specialist
Author: Alex Mancía
Version: 1.0.1
License: GPL v2 or later
Text Domain: am-portfolio

This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what you've learned with others.
*/

/* ==========================================================================
   VERSIÓN MEJORADA - CSS COMPLETO Y FUNCIONAL
   ========================================================================== */

/* ==========================================================================
   Reset and Base Styles
   ========================================================================== */

/* Custom properties for consistent theming */
:root {
    --color-primary: #3b82f6;
    --color-secondary: #10b981;
    --color-dark-bg: #0f172a;
    --color-light-text: #cbd5e1;
    --color-subtle-text: #64748b;
    --font-sans: 'Inter', sans-serif;
    --font-mono: 'Fira Code', monospace;
    --transition-base: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    --transition-slow: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Reset and base styles - Tailwind handles most of this */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px; /* Account for fixed header */
}

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--color-light-text);
    background-color: var(--color-dark-bg);
    overflow-x: hidden;
}

/* ==========================================================================
   Custom Cursor Styles
   ========================================================================== */

#custom-cursor {
    transition: var(--transition-base);
    mix-blend-mode: difference;
    pointer-events: none;
    z-index: 9999;
}

#custom-cursor.cursor-large {
    transform: scale(2);
    background-color: var(--color-secondary) !important;
}

/* Hide custom cursor on touch devices */
@media (hover: none) and (pointer: coarse) {
    #custom-cursor {
        display: none !important;
    }
}

/* ==========================================================================
   Typography Enhancements
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-mono);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
}

.font-mono {
    font-family: var(--font-mono);
}

/* Code blocks and inline code */
code, pre {
    font-family: var(--font-mono);
    background: rgba(55, 65, 81, 0.5);
    border-radius: 0.375rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

pre {
    padding: 1rem;
    overflow-x: auto;
    border: 1px solid rgba(75, 85, 99, 0.3);
}

/* ==========================================================================
   Custom Scrollbar
   ========================================================================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1e293b;
}

::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2563eb;
}

/* Firefox scrollbar */
html {
    scrollbar-width: thin;
    scrollbar-color: var(--color-primary) #1e293b;
}

/* ==========================================================================
   Animation Classes and Keyframes
   ========================================================================== */

/* Fade in up animation */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: var(--transition-slow);
}

.fade-in-up.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Fade in left animation */
.fade-in-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: var(--transition-slow);
}

.fade-in-left.animate {
    opacity: 1;
    transform: translateX(0);
}

/* Scale in animation */
.scale-in {
    opacity: 0;
    transform: scale(0.95);
    transition: var(--transition-slow);
}

.scale-in.animate {
    opacity: 1;
    transform: scale(1);
}

/* Glitch effect for special text */
@keyframes glitch {
    0% { 
        transform: translate(0);
        filter: hue-rotate(0deg);
    }
    20% { 
        transform: translate(-2px, 2px);
        filter: hue-rotate(90deg);
    }
    40% { 
        transform: translate(-2px, -2px);
        filter: hue-rotate(180deg);
    }
    60% { 
        transform: translate(2px, 2px);
        filter: hue-rotate(270deg);
    }
    80% { 
        transform: translate(2px, -2px);
        filter: hue-rotate(360deg);
    }
    100% { 
        transform: translate(0);
        filter: hue-rotate(0deg);
    }
}

.glitch {
    position: relative;
    animation: glitch 2s infinite;
}

/* Pulse animation for elements */
@keyframes pulse-custom {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.pulse-custom {
    animation: pulse-custom 2s ease-in-out infinite;
}

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

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

/* ==========================================================================
   Component Specific Styles
   ========================================================================== */

/* Glassmorphism effects */
.glass-effect {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Enhanced card hover effects */
.card-hover {
    transition: var(--transition-slow);
    transform: translateZ(0); /* Hardware acceleration */
}

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

/* Timeline specific styles */
.timeline {
    position: relative;
}

.timeline-item {
    opacity: 0;
    transform: translateX(-20px);
    transition: var(--transition-slow);
}

.timeline-item.animate {
    opacity: 1;
    transform: translateX(0);
}

.timeline-item:nth-child(even) {
    transition-delay: 0.1s;
}

.timeline-item:nth-child(odd) {
    transition-delay: 0.2s;
}

/* Enhanced button styles */
.btn-primary {
    background: var(--color-primary);
    color: var(--color-dark-bg);
    border: 2px solid var(--color-primary);
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
}

.btn-primary::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-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    background: var(--color-secondary);
    border-color: var(--color-secondary);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

.btn-ghost {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
}

.btn-ghost::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: var(--color-primary);
    transition: width 0.3s ease;
    z-index: -1;
}

.btn-ghost:hover::before {
    width: 100%;
}

.btn-ghost:hover {
    color: var(--color-dark-bg);
    transform: translateY(-2px);
}

/* ==========================================================================
   Header Enhancements
   ========================================================================== */

.site-header {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: var(--transition-base);
}

.site-header.scrolled {
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

/* Navigation link hover effects */
.site-header nav a {
    position: relative;
    transition: var(--transition-base);
}

.site-header nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 50%;
    background: var(--color-primary);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.site-header nav a:hover::after {
    width: 100%;
}

/* ==========================================================================
   Project Cards Enhanced Styles
   ========================================================================== */

.project-card {
    overflow: hidden;
    border-radius: 1rem;
    transition: var(--transition-slow);
    position: relative;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(59, 130, 246, 0.1), rgba(16, 185, 129, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

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

.project-card .project-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(15, 23, 42, 0.95) 0%,
        rgba(15, 23, 42, 0.7) 50%,
        transparent 100%
    );
    opacity: 0;
    transition: var(--transition-slow);
    z-index: 2;
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-card .project-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    transform: translateY(100%);
    transition: var(--transition-slow);
    z-index: 3;
}

.project-card:hover .project-content {
    transform: translateY(0);
}

/* ==========================================================================
   Blog Specific Styles
   ========================================================================== */

/* Blog post card enhancements */
.blog-post-card {
    transition: var(--transition-slow);
    position: relative;
    overflow: hidden;
}

.blog-post-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 0%;
    background: linear-gradient(to bottom, var(--color-primary), var(--color-secondary));
    transition: height 0.3s ease;
}

.blog-post-card:hover::after {
    height: 100%;
}

/* Enhanced typography for blog content */
.blog-content h1,
.blog-content h2,
.blog-content h3 {
    color: var(--color-light-text);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.blog-content h1 {
    font-size: 2.25rem;
    line-height: 1.2;
}

.blog-content h2 {
    font-size: 1.875rem;
    line-height: 1.3;
}

.blog-content h3 {
    font-size: 1.5rem;
    line-height: 1.4;
}

.blog-content p {
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.blog-content a {
    color: var(--color-primary);
    text-decoration: underline;
    text-decoration-color: transparent;
    transition: text-decoration-color 0.3s ease;
}

.blog-content a:hover {
    text-decoration-color: var(--color-primary);
}

/* ==========================================================================
   Form Styles
   ========================================================================== */

input, textarea, select {
    background: rgba(55, 65, 81, 0.5);
    border: 1px solid rgba(75, 85, 99, 0.5);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    color: var(--color-light-text);
    transition: var(--transition-base);
    width: 100%;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

input::placeholder, textarea::placeholder {
    color: var(--color-subtle-text);
}

/* ==========================================================================
   Accessibility Improvements
   ========================================================================== */

/* Focus states for better keyboard navigation */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Skip link styles */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 6px;
    z-index: 999999;
    text-decoration: none;
    padding: 8px 16px;
    background: var(--color-primary);
    color: var(--color-dark-bg);
    border-radius: 4px;
}

.skip-link:focus {
    left: 6px;
}

/* Screen reader text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sr-only:focus {
    position: static;
    width: auto;
    height: auto;
    padding: 0.25rem 0.5rem;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background: var(--color-primary);
    color: var(--color-dark-bg);
    border-radius: 0.25rem;
}

/* ==========================================================================
   WordPress Specific Styles
   ========================================================================== */

/* Alignment classes */
.alignnone {
    margin: 1rem 0;
}

.aligncenter {
    display: block;
    margin: 1rem auto;
}

.alignleft {
    float: left;
    margin: 0 1rem 1rem 0;
}

.alignright {
    float: right;
    margin: 0 0 1rem 1rem;
}

/* Caption styles */
.wp-caption {
    max-width: 100%;
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 0.5rem;
    overflow: hidden;
}

.wp-caption-text {
    padding: 0.75rem;
    font-size: 0.875rem;
    color: var(--color-subtle-text);
    text-align: center;
    background: rgba(55, 65, 81, 0.3);
}

/* Gallery styles */
.gallery {
    display: grid;
    grid-gap: 1rem;
    margin-bottom: 2rem;
}

.gallery-columns-2 { grid-template-columns: repeat(2, 1fr); }
.gallery-columns-3 { grid-template-columns: repeat(3, 1fr); }
.gallery-columns-4 { grid-template-columns: repeat(4, 1fr); }

.gallery-item {
    border-radius: 0.5rem;
    overflow: hidden;
    transition: var(--transition-base);
}

.gallery-item:hover {
    transform: scale(1.05);
}

/* ==========================================================================
   Back to Top Button
   ========================================================================== */

#back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    background: var(--color-primary);
    color: var(--color-dark-bg);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    transition: var(--transition-base);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
}

#back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
}

#back-to-top:hover {
    background: var(--color-secondary);
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

/* ==========================================================================
   Media Queries for Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    /* Mobile-specific adjustments */
    .hero-title {
        font-size: 3rem !important;
    }
    
    .timeline-item {
        transform: none;
    }
    
    .timeline-item.animate {
        transform: none;
    }
    
    /* Adjust cards for mobile */
    .card-hover:hover {
        transform: none;
    }
    
    /* Mobile navigation enhancements */
    #mobile-menu {
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }
    
    /* Adjust back to top button for mobile */
    #back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 2.5rem;
        height: 2.5rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.5rem !important;
    }
    
    /* Smaller spacing on mobile */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    body {
        background: white !important;
        color: black !important;
    }
    
    .site-header,
    .site-footer,
    #back-to-top,
    #custom-cursor {
        display: none !important;
    }
    
    a {
        text-decoration: underline !important;
    }
    
    .project-card,
    .blog-post-card {
        border: 1px solid #ccc !important;
        break-inside: avoid;
    }
}

/* ==========================================================================
   Performance Optimizations
   ========================================================================== */

/* Hardware acceleration for animations */
.timeline-item,
.project-card,
.expertise-card,
.blog-post-card {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Reduce motion for users with vestibular disorders */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .fade-in-up,
    .fade-in-left,
    .scale-in {
        animation: none;
        transition: none;
        opacity: 1;
        transform: none;
    }
}