/* Variables CSS */
:root {
    --primary-color: #1e3a8a;
    --secondary-color: #111827;
    --accent-color: #1d4ed8;
    --text-dark: #1f2937;
    --text-light: #ffffff;
    --bg-light: #f8f9fa;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 0.5rem;
    --transition: all 0.3s ease;
}

/* Reset y base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    scroll-behavior: smooth;
}

/* Utilidades */
.text-primary { color: var(--primary-color) !important; }
.bg-primary { background-color: var(--primary-color) !important; }
.btn-primary { 
    background-color: var(--primary-color); 
    border-color: var(--primary-color);
    transition: var(--transition);
}
.btn-primary:hover { 
    background-color: var(--secondary-color); 
    border-color: var(--secondary-color);
    transform: translateY(-2px);
}

/* Navegación */
.navbar {
    transition: var(--transition);
    box-shadow: none;
    z-index: 1050;
    margin: 15px;
    border-radius: 25px;
    width: calc(100% - 30px);
    left: 15px;
    right: 15px;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    margin: 0 0.5rem;
    transition: var(--transition);
    position: relative;
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color) !important;
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: var(--primary-color);
    transition: var(--transition);
    transform: translateX(-50%);
}

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

/* Skills Cards Flip Effects */
.skill-card-hover {
    perspective: 1000px;
}

.skill-card-hover:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(30, 58, 138, 0.2) !important;
}

.skill-card-hover:hover .skill-front {
    opacity: 0;
    transform: rotateY(-180deg);
    z-index: 1 !important;
}

.skill-card-hover:hover .skill-back {
    opacity: 1 !important;
    transform: rotateY(0deg) !important;
    z-index: 10 !important;
}

.skill-back {
    z-index: 1;
}

.skill-front {
    z-index: 2;
}

.dot-white {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transition: all 0.3s ease;
}

.dot-white.active {
    background: white;
    box-shadow: 0 2px 8px rgba(255,255,255,0.3);
}

.skill-card-hover:hover .dot-white.active {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(255,255,255,0.4);
}

/* Service Cards Effects */
.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(30, 58, 138, 0.15) !important;
    border-color: rgba(30, 58, 138, 0.2) !important;
}

.service-card:hover .service-icon {
    transform: scale(1.1);
    color: #3b82f6 !important;
}

.service-card {
    position: relative;
    overflow: hidden;
}

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

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

/* Subtitle Hero Effects */
.subtitle-hero {
    position: relative;
    animation: shimmer 4s ease-in-out infinite;
}

.subtitle-hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shine 3s infinite;
}

@keyframes shimmer {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.2);
    }
}

@keyframes shine {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Logo Hero Effects */
.logo-hero:hover {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 15px 40px rgba(255,255,255,0.5)) brightness(1.1);
}

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

@keyframes moveHorizontal {
    0%, 100% {
        transform: translateX(0px);
    }
    50% {
        transform: translateX(30px);
    }
}

@keyframes moveDiagonal {
    0%, 100% {
        transform: translate(0px, 0px);
    }
    25% {
        transform: translate(20px, -15px);
    }
    50% {
        transform: translate(-10px, -25px);
    }
    75% {
        transform: translate(-20px, 10px);
    }
}

@keyframes moveCircular {
    0% {
        transform: translate(0px, 0px);
    }
    25% {
        transform: translate(15px, -15px);
    }
    50% {
        transform: translate(0px, -30px);
    }
    75% {
        transform: translate(-15px, -15px);
    }
    100% {
        transform: translate(0px, 0px);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.5;
    }
}

@keyframes modalSlideIn {
    0% {
        transform: translate(-50%, -60%);
        opacity: 0;
        scale: 0.8;
    }
    100% {
        transform: translate(-50%, -50%);
        opacity: 1;
        scale: 1;
    }
}

/* Hero Section con video de fondo */
.hero-section {
    position: relative;
    overflow: hidden;
}

.video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.video-fallback {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e3a8a 0%, #111827 100%);
    z-index: 1;
}

.video-background video {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100vw;
    height: 56.25vw;
    min-height: 100vh;
    min-width: 177.77vh;
    transform: translate(-50%, -50%);
    object-fit: cover;
    pointer-events: none;
    z-index: 2;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 58, 138, 0.8);
    z-index: 2;
}

.hero-section .container {
    position: relative;
    z-index: 3;
}

.hero-section img {
    border: 4px solid rgba(255, 255, 255, 0.3);
    transition: var(--transition);
}

.hero-section img:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.6);
}

/* Secciones */
section {
    padding: 5rem 0;
}

.display-5 {
    position: relative;
    margin-bottom: 2rem;
}

.display-5::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 2px;
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.card-img-top {
    transition: var(--transition);
}

.card:hover .card-img-top {
    transform: scale(1.05);
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.5em 0.75em;
}

/* Progress bars */
.progress {
    height: 8px;
    border-radius: 4px;
    background-color: #e9ecef;
}

.progress-bar {
    border-radius: 4px;
    transition: width 1s ease-in-out;
}

/* Skills animation */
.skill-item {
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition);
}

.skill-item.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Accordion */
.accordion-button {
    font-weight: 600;
    background-color: transparent;
    border: none;
    box-shadow: none;
}

.accordion-button:not(.collapsed) {
    background-color: var(--bg-light);
    color: var(--primary-color);
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(10, 147, 150, 0.25);
}

/* Formularios */
.form-control {
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(10, 147, 150, 0.25);
}

/* Botones */
.btn {
    border-radius: var(--border-radius);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
}

.btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

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

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Video responsive */
.ratio {
    position: relative;
}

.ratio iframe {
    border: none;
    transition: var(--transition);
}

.ratio:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 0;
    }
    
    .video-background iframe {
        height: 100vh;
        width: 177.77vh;
    }
    
    .display-3 {
        font-size: 2.5rem;
    }
    
    .hero-section img {
        width: 150px !important;
        height: 150px !important;
    }
    
    section {
        padding: 3rem 0;
    }
    
    .navbar-nav .nav-link {
        margin: 0.25rem 0;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .d-flex.gap-3 {
        flex-direction: column;
        gap: 0.5rem !important;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 1rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .hero-section .btn {
        font-size: 0.9rem;
        padding: 0.6rem 1.2rem;
    }
}

/* Efectos adicionales */
.shadow-sm {
    box-shadow: var(--shadow) !important;
}

.rounded {
    border-radius: var(--border-radius) !important;
}

/* Scroll suave para navegación */
html {
    scroll-padding-top: 100px;
}

/* Ajustes responsive para navbar */
@media (max-width: 768px) {
    .navbar {
        margin: 10px;
        width: calc(100% - 20px);
        left: 10px;
        right: 10px;
        border-radius: 20px;
    }
}

/* Loading animation para skills */
@keyframes progressLoad {
    from { width: 0; }
}

.progress-bar {
    animation: progressLoad 2s ease-in-out;
}

/* Hover effects para iconos */
.fas, .fab {
    transition: var(--transition);
}

.btn:hover .fas,
.btn:hover .fab {
    transform: scale(1.1);
}

/* Footer */
footer {
    background: linear-gradient(135deg, var(--text-dark) 0%, var(--secondary-color) 100%) !important;
}

/* Mejoras de accesibilidad */
.btn:focus,
.form-control:focus,
.nav-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Banner animado mejorado */
.animated-banner {
    position: relative;
    overflow: hidden;
}

.banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.marquee-container {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}

.marquee-content {
    display: inline-block;
    animation: marquee 25s linear infinite;
    font-size: 4rem;
    font-weight: 900;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    letter-spacing: 2px;
    white-space: nowrap;
}

.marquee-item {
    margin-right: 4rem;
    display: inline-block;
    background: linear-gradient(45deg, #ffffff, #e2e8f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes marquee {
    0% {
        transform: translateX(0%);
    }
    100% {
        transform: translateX(-50%);
    }
}

@media (max-width: 768px) {
    .marquee-content {
        font-size: 2.5rem;
    }
    
    .marquee-item {
        margin-right: 2rem;
    }
}

/* Efectos adicionales para el banner */
.animated-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shine 3s infinite;
    z-index: 1;
}

@keyframes shine {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    footer {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .hero-section {
        background: none !important;
        color: black !important;
    }
}
/* Fondo tecnológico animado para la sección Sobre Mí */
.tech-background {
    background: linear-gradient(45deg, rgba(30, 58, 138, 0.05) 0%, rgba(59, 130, 246, 0.05) 100%);
}

.circuit-lines {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(90deg, rgba(30, 58, 138, 0.2) 1px, transparent 1px),
        linear-gradient(rgba(30, 58, 138, 0.2) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: circuitMove 20s linear infinite;
}

.circuit-lines::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 25px 25px, rgba(59, 130, 246, 0.4) 2px, transparent 2px),
        radial-gradient(circle at 75px 75px, rgba(30, 58, 138, 0.3) 1px, transparent 1px);
    background-size: 100px 100px;
    animation: circuitPulse 3s ease-in-out infinite alternate;
}

.floating-particles {
    position: absolute;
    width: 100%;
    height: 100%;
}

.floating-particles::before,
.floating-particles::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(59, 130, 246, 0.8);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    animation: floatParticles 15s linear infinite;
}

.floating-particles::before {
    top: 20%;
    left: 10%;
    animation-delay: -5s;
}

.floating-particles::after {
    top: 60%;
    right: 15%;
    animation-delay: -10s;
    background: rgba(30, 58, 138, 0.6);
    box-shadow: 0 0 8px rgba(30, 58, 138, 0.4);
}

.binary-rain {
    position: absolute;
    width: 100%;
    height: 100%;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: rgba(59, 130, 246, 0.2);
    overflow: hidden;
}

.binary-rain::before {
    content: '01001001 01101110 01101110 01101111 01110110 01100001 01110100 01101001 01101111 01101110';
    position: absolute;
    top: -20px;
    left: 0;
    width: 100%;
    animation: binaryFall 25s linear infinite;
    white-space: nowrap;
    color: rgba(59, 130, 246, 0.2);
    text-shadow: 0 0 5px rgba(59, 130, 246, 0.3);
}

.binary-rain::after {
    content: '01000100 01100101 01110110 01100101 01101100 01101111 01110000 01101101 01100101 01101110 01110100';
    position: absolute;
    top: -20px;
    right: 0;
    width: 100%;
    animation: binaryFall 30s linear infinite;
    animation-delay: -10s;
    white-space: nowrap;
    color: rgba(30, 58, 138, 0.2);
    text-shadow: 0 0 5px rgba(30, 58, 138, 0.3);
}

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

@keyframes circuitPulse {
    0% { opacity: 0.1; }
    100% { opacity: 0.3; }
}

@keyframes floatParticles {
    0% { transform: translateY(100vh) translateX(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100px) translateX(100px); opacity: 0; }
}

@keyframes binaryFall {
    0% { transform: translateY(-100px); opacity: 0; }
    10% { opacity: 0.1; }
    90% { opacity: 0.1; }
    100% { transform: translateY(calc(100vh + 100px)); opacity: 0; }
}

/* Efecto adicional de líneas de conexión */
.tech-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(45deg, transparent 40%, rgba(59, 130, 246, 0.05) 50%, transparent 60%),
        linear-gradient(-45deg, transparent 40%, rgba(30, 58, 138, 0.05) 50%, transparent 60%);
    background-size: 200px 200px;
    animation: techScan 8s ease-in-out infinite;
}

@keyframes techScan {
    0%, 100% { transform: translateX(-100px); }
    50% { transform: translateX(100px); }
}

/* Nuevos elementos tecnológicos */
.tech-dots {
    position: absolute;
    width: 100%;
    height: 100%;
}

.tech-dots::before {
    content: '• • • • • • • • • •';
    position: absolute;
    top: 30%;
    left: 0;
    width: 100%;
    color: rgba(59, 130, 246, 0.3);
    font-size: 20px;
    animation: dotMove 12s linear infinite;
    letter-spacing: 50px;
}

.tech-dots::after {
    content: '◆ ◆ ◆ ◆ ◆ ◆ ◆';
    position: absolute;
    bottom: 30%;
    right: 0;
    width: 100%;
    color: rgba(30, 58, 138, 0.3);
    font-size: 16px;
    animation: dotMove 15s linear infinite reverse;
    letter-spacing: 60px;
    text-align: right;
}

.data-stream {
    position: absolute;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(59, 130, 246, 0.05) 10px,
        rgba(59, 130, 246, 0.05) 20px
    );
    animation: streamFlow 8s linear infinite;
}

@keyframes dotMove {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes streamFlow {
    0% { background-position: 0 0; }
    100% { background-position: 100px 100px; }
}