/* ===== VARIABLES ===== */
:root {
    --primary-color: #4A90E2;
    --secondary-color: #6C63FF;
    --success-color: #28a745;
    --dark-color: #2c3e50;
    --light-color: #f8f9fa;
    --text-muted: #6c757d;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

/* ===== NAVIGATION ===== */
.navbar {
    background: rgba(44, 62, 80, 0.95) !important;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    padding: 1rem 0;
}

.navbar.scrolled {
    padding: 0.5rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
    color: var(--primary-color) !important;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.navbar-nav .nav-link {
    color: #fff !important;
    margin: 0 0.5rem;
    transition: all 0.3s ease;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    font-size: 0.9rem;
}

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

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

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

/* ===== HERO SECTION ===== */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

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

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.slide.active {
    opacity: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(44, 62, 80, 0.7) 0%, rgba(52, 73, 94, 0.6) 100%);
    z-index: 2;
}

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

.hero-content h1 {
    color: #fff;
    margin-bottom: 1.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-content p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.25rem;
    margin-bottom: 2rem;
}

.hero-buttons .btn {
    margin-right: 1rem;
    margin-bottom: 1rem;
    border-radius: 50px;
    padding: 12px 30px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-primary:hover {
    background: transparent;
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(74, 144, 226, 0.4);
}

.btn-outline-light:hover {
    background: #fff;
    color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.3);
}

.social-links a {
    color: #fff;
    transition: all 0.3s ease;
    display: inline-block;
}

.social-links a:hover {
    color: var(--primary-color);
    transform: translateY(-5px);
}

.hero-image img {
    max-width: 400px;
    border: 5px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

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

/* ===== SECTIONS ===== */
section {
    padding: 80px 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: var(--dark-color);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* ===== ABOUT SECTION ===== */
#about {
    background: linear-gradient(rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.75)), 
                url('img/fondo-sobremi.jpeg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

#about h3 {
    color: var(--dark-color);
    font-weight: 600;
}

#about .text-muted {
    font-size: 1.1rem;
    line-height: 1.8;
}

.profile-container {
    position: relative;
    width: 350px;
    height: 350px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.profile-container::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    z-index: -1;
}

.profile-container:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.profile-container:hover::before {
    background: linear-gradient(45deg, var(--secondary-color), var(--primary-color));
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    border-radius: 50%;
    transition: all 0.3s ease;
}

/* ===== SKILLS SECTION ===== */
#skills {
    background: linear-gradient(rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0.65)), 
                url('img/fondo-habilidad.jfif');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    filter: brightness(1.15);
}

.skill-card {
    background: rgba(255, 255, 255, 0.75);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 100%;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.skill-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.skill-item {
    margin-bottom: 1.5rem;
}

.progress {
    height: 10px;
    border-radius: 5px;
    background: #e9ecef;
    overflow: visible;
}

.progress-bar {
    border-radius: 5px;
    position: relative;
    animation: progressAnimation 2s ease-in-out;
}

@keyframes progressAnimation {
    0% { width: 0 !important; }
}

.tech-stack {
    padding: 2rem;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.tech-icons i {
    color: var(--text-muted);
    transition: all 0.3s ease;
    margin: 0.5rem;
}

.tech-icons i:hover {
    color: var(--primary-color);
    transform: translateY(-5px) scale(1.1);
}

.tech-icons i.fa-html5 { color: #E34C26; }
.tech-icons i.fa-css3-alt { color: #1572B6; }
.tech-icons i.fa-js { color: #F7DF1E; }
.tech-icons i.fa-react { color: #61DAFB; }
.tech-icons i.fa-vuejs { color: #4FC08D; }
.tech-icons i.fa-node-js { color: #339933; }
.tech-icons i.fa-python { color: #3776AB; }
.tech-icons i.fa-git-alt { color: #F05032; }

/* ===== PROJECTS SECTION ===== */
.project-card {
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    margin-bottom: 2rem;
    height: 100%;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.project-image {
    height: 250px;
    overflow: hidden;
    position: relative;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.1);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.project-links {
    display: flex;
    gap: 1rem;
}

.project-links a {
    background: var(--primary-color);
    color: #fff;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.project-links a:hover {
    background: var(--secondary-color);
    transform: translateY(-3px);
}

.project-content {
    padding: 1.5rem;
}

.project-content h4 {
    color: var(--dark-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tag {
    background: var(--light-color);
    color: var(--text-muted);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.85rem;
    border: 1px solid #dee2e6;
}

/* ===== CONTACT SECTION ===== */
#contact {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

.form-control {
    border-radius: 10px;
    border: none;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.form-control:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(74, 144, 226, 0.25);
    color: #fff;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.contact-info i {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* ===== FOOTER ===== */
footer {
    background: #1a1a1a !important;
    border-top: 1px solid #333;
}

.social-links-footer a {
    color: var(--text-muted);
    transition: all 0.3s ease;
    margin: 0 0.5rem;
}

.social-links-footer a:hover {
    color: var(--primary-color);
    transform: translateY(-3px);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 0;
        text-align: center;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-buttons .btn {
        display: block;
        margin: 0.5rem auto;
        width: 200px;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .tech-icons i {
        font-size: 2rem;
        margin: 0.25rem;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .navbar-nav .nav-link {
        font-size: 0.8rem;
        letter-spacing: 0.3px;
    }
    
    .project-overlay {
        opacity: 1;
        background: rgba(0, 0, 0, 0.5);
    }
    
    .project-links {
        justify-content: center;
    }
    
    .whatsapp-float {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
        font-size: 24px;
    }
    
    .cv-float {
        bottom: 80px;
        right: 20px;
        padding: 10px 16px;
        font-size: 0.75rem;
        min-width: 120px;
    }
    
    .cv-float i {
        font-size: 16px;
        margin-right: 6px;
    }
}

@media (max-width: 576px) {
    section {
        padding: 60px 0;
    }
    
    .hero-content h1 {
        font-size: 1.75rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .skill-card,
    .tech-stack {
        padding: 1.5rem;
    }
    
    .project-content {
        padding: 1rem;
    }
    
    .navbar-brand {
        font-size: 1rem;
        letter-spacing: 0.5px;
    }
    
    .navbar-nav .nav-link {
        font-size: 0.75rem;
        margin: 0 0.3rem;
    }
    
    .whatsapp-float {
        width: 45px;
        height: 45px;
        bottom: 15px;
        right: 15px;
        font-size: 20px;
    }
    
    .cv-float {
        bottom: 70px;
        right: 15px;
        padding: 8px 14px;
        font-size: 0.7rem;
        min-width: 100px;
    }
    
    .cv-float i {
        font-size: 14px;
        margin-right: 5px;
    }
    
    .profile-container {
        width: 250px;
        height: 250px;
    }
    
    .profile-image {
        width: 250px;
        height: 250px;
    }
}

/* ===== ANIMATIONS ===== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

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

/* ===== SCROLL TO TOP BUTTON ===== */
.scroll-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary-color);
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    text-decoration: none;
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background: var(--secondary-color);
    transform: translateY(-5px);
}

/* ===== LOADING SPINNER ===== */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== WHATSAPP FLOATING BUTTON ===== */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 30px;
    right: 30px;
    background-color: #25d366;
    color: #fff;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.whatsapp-float:hover {
    background-color: #128c7e;
    color: #fff;
    transform: scale(1.1);
    box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.5);
}

.whatsapp-float i {
    margin: 0;
}

/* Pulse animation for WhatsApp button */
@keyframes whatsappPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

.whatsapp-float {
    animation: whatsappPulse 2s infinite;
}

/* ===== CV PDF FLOATING BUTTON ===== */
.cv-float {
    position: fixed;
    bottom: 100px;
    right: 30px;
    background: #dc3545;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.4);
    z-index: 999;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.85rem;
    min-width: 150px;
}

.cv-float:hover {
    background: #c82333;
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.5);
}

.cv-float i {
    margin-right: 8px;
    font-size: 18px;
}

.cv-float span {
    white-space: nowrap;
}

/* Pulse animation for CV button */
@keyframes cvPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(220, 53, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

.cv-float {
    animation: cvPulse 2.5s infinite;
    animation-delay: 0.5s;
}

/* ===== CUSTOM TOAST ===== */
.custom-toast {
    position: fixed;
    top: 100px;
    right: 20px;
    background: var(--success-color);
    color: #fff;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    z-index: 1050;
}

.custom-toast.show {
    opacity: 1;
    transform: translateX(0);
}