:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --info-color: #06b6d4;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --light-color: #f8fafc;
    --dark-color: #0f172a;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-dark: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    --border-radius: 0.75rem;
    --border-radius-lg: 1rem;
}

/* Variables del tema oscuro */
[data-bs-theme="dark"] {
    --bs-body-bg: #1a1a1a;
    --bs-body-color: #e9ecef;
    --bs-card-bg: #2d2d2d;
    --bs-border-color: #404040;
}

/* Estilos Globales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    scroll-behavior: smooth;
    transition: var(--transition);
}

/* Tipografía */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
}

.section-title {
    position: relative;
    font-weight: 700;
    margin-bottom: 3rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(45deg, var(--primary-color), #0056b3);
    border-radius: 2px;
}

/* Navegación */
.navbar {
    backdrop-filter: blur(10px);
    background: rgba(13, 110, 253, 0.95) !important;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

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

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

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

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #fff;
    transition: width 0.3s ease;
}

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

/* Sección Hero */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    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="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.1;
}

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

.profile-image-container {
    position: relative;
    z-index: 2;
}

.profile-image {
    width: 300px;
    height: 300px;
    object-fit: cover;
    border: 5px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition);
}

.profile-image:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.4);
}

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

.animate-fade-in {
    animation: fadeInUp 0.8s ease-out;
}

.animate-fade-in-delay-1 {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.animate-fade-in-delay-2 {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.animate-fade-in-delay-3 {
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

/* Tarjetas */
.card {
    border: none;
    border-radius: 15px;
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

[data-bs-theme="dark"] .card {
    background-color: rgba(30, 41, 59, 0.9);
    border: 2px solid rgba(56, 189, 248, 0.6) !important;
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06), inset 0 0 0 1px rgba(56, 189, 248, 0.1);
}

[data-bs-theme="dark"] .card:hover {
    border-color: rgba(56, 189, 248, 0.8) !important;
    box-shadow: 0 20px 25px -5px rgba(56, 189, 248, 0.3), 0 8px 10px -6px rgba(56, 189, 248, 0.2);
    transform: translateY(-4px);
}

[data-bs-theme="dark"] .card-body {
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 0.75rem;
    background: rgba(51, 65, 85, 0.3);
}

/* Línea de tiempo */
.timeline-item {
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -30px;
    top: 20px;
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border-radius: 50%;
    z-index: 2;
}

.timeline-item::after {
    content: '';
    position: absolute;
    left: -24px;
    top: 32px;
    width: 2px;
    height: calc(100% - 12px);
    background: linear-gradient(to bottom, var(--primary-color), transparent);
}

.timeline-item:last-child::after {
    display: none;
}

/* Habilidades */
.skills-list {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.skills-list .badge {
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
    font-weight: 500;
    word-break: break-word;
    white-space: normal;
    max-width: 100%;
    display: inline-block;
    text-overflow: ellipsis;
    overflow: hidden;
}

/* Sección de Contacto */
.contact-item {
    text-align: center;
    padding: 2rem 1rem;
}

.contact-item i {
    display: block;
    margin-bottom: 1rem;
}

.contact-item a {
    text-decoration: none;
    transition: var(--transition);
}

.contact-item a:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

/* Botones */
.btn {
    border-radius: 50px;
    padding: 0.75rem 2rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition);
    border: none;
    position: relative;
    overflow: hidden;
}

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

.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), #0056b3);
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(13, 110, 253, 0.4);
}

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

.btn-outline-primary:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
}

/* Alternador de Tema */
#themeToggle {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

#themeToggle:hover {
    transform: rotate(180deg);
}

/* Elementos de Información */
.info-item {
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
}

.info-item a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.info-item a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Social Links */
.social-links a {
    display: inline-block;
    font-size: 1.5rem;
    transition: var(--transition);
}

.social-links a:hover {
    transform: translateY(-3px);
    opacity: 0.8;
}

/* Badges */
.badge {
    font-weight: 500;
    letter-spacing: 0.5px;
}

.badge.bg-primary {
    background: linear-gradient(45deg, var(--primary-color), #0056b3) !important;
}

.badge.bg-secondary {
    background: linear-gradient(45deg, var(--secondary-color), #495057) !important;
}

.badge.bg-success {
    background: linear-gradient(45deg, var(--success-color), #146c43) !important;
}

/* Proyectos */
.project-card {
    transition: var(--transition);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    /* min-height: 450px; */
}

.project-card .card-body {
    padding: 2rem;
    margin: 20px 20px 20px 0;
    min-height: 360px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.project-image {
    height: 400px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    padding: 20px;
}

.project-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: var(--transition);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.technologies .badge {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
    margin: 0.2rem 0.2rem 0.2rem 0;
    border-radius: 20px;
    font-weight: 500;
}

[data-bs-theme="dark"] .project-card {
    background-color: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(56, 189, 248, 0.2);
}

[data-bs-theme="dark"] .project-image {
    background: #2d2d2d !important;
}

/* Asegurar que las columnas tengan la misma altura */
.project-card .row {
    align-items: stretch;
}

.project-card .col-md-6 {
    display: flex;
    flex-direction: column;
}

/* Diseño Responsivo*/
@media (max-width: 992px) {
    .mt-responsive{
        margin-top: 6rem;
    }
    
    .project-image {
        height: 320px;
        padding: 15px;
    }
    
    .project-card {
        min-height: 400px;
    }
    
    .project-card .card-body {
        padding: 1.5rem;
        margin: 15px 10px;
        min-height: 290px;
    }
}

@media (max-width: 768px) {
    .hero-section {
        text-align: center;
    }
    
    .profile-image {
        width: 250px;
        height: 250px;
        margin-bottom: 2rem;
    }
    
    .timeline-item::before,
    .timeline-item::after {
        display: none;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
    
    .project-image {
        height: 250px;
        margin-bottom: 1rem;
        padding: 10px;
    }
    
    .project-card {
        min-height: auto;
    }
    
    .project-card .card-body {
        padding: 1.25rem;
        margin: 15px 10px;
        min-height: auto;
        justify-content: flex-start;
    }
    
    .project-card .row {
        flex-direction: column;
    }
    
    .project-card .col-md-4,
    .project-card .col-md-8 {
        max-width: 100%;
        flex: 0 0 100%;
    }
}

@media (max-width: 576px) {
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    .profile-image {
        width: 200px;
        height: 200px;
    }
    
    .hero-content .btn {
        display: block;
        margin-bottom: 1rem;
    }
}

/* Estilos Específicos del Modo Oscuro */
[data-bs-theme="dark"] {
    --bs-bg-opacity: 1;
}

[data-bs-theme="dark"] .hero-section {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

[data-bs-theme="dark"] .bg-light {
    background-color: #2d2d2d !important;
}

[data-bs-theme="dark"] .text-muted {
    color: #adb5bd !important;
}

[data-bs-theme="dark"] .card {
    background-color: #2d2d2d;
    border: 1px solid #404040;
}

[data-bs-theme="dark"] .navbar {
    background: rgba(45, 45, 45, 0.95) !important;
}

/* Animación de Carga */
.loading {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.loading.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Animaciones de Desplazamiento */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

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

/* Barra de Desplazamiento Personalizada */
::-webkit-scrollbar {
    width: 8px;
}

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

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

::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-track {
    background: #2d2d2d;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #495057;
}

/* Botón Volver Arriba */
.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), #4f46e5);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.scroll-to-top:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #4f46e5, var(--primary-color));
}

.scroll-to-top:active {
    transform: translateY(-1px) scale(0.95);
}

[data-bs-theme="dark"] .scroll-to-top {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.9), rgba(79, 70, 229, 0.9));
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
    border: 1px solid rgba(56, 189, 248, 0.2);
}

[data-bs-theme="dark"] .scroll-to-top:hover {
    background: linear-gradient(135deg, rgba(56, 189, 248, 1), rgba(79, 70, 229, 1));
    box-shadow: 0 8px 25px rgba(56, 189, 248, 0.4);
}

@media print {
    .navbar,
    #themeToggle,
    .btn,
    footer {
        display: none !important;
    }
    
    .hero-section {
        background: none !important;
        color: #000 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}
