:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --bg-color: #ffffff;
    --text-color: #212529;
    --card-bg: #f8f9fa;
    --navbar-bg: rgba(255, 255, 255, 0.95);
    --shadow: 0 5px 15px rgba(0,0,0,0.1);
}

[data-theme="dark"] {
    --primary-color: #4a9eff;
    --secondary-color: #c9d1d9;
    --bg-color: #0d1117;
    --text-color: #e6edf3;
    --card-bg: #161b22;
    --navbar-bg: rgba(13, 17, 23, 0.95);
    --shadow: 0 5px 15px rgba(0,0,0,0.5);
}

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: all 0.3s ease;
    overflow-x: hidden;
}

/* Navbar */
.navbar {
    background-color: var(--navbar-bg) !important;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color) !important;
}

.nav-link {
    color: var(--text-color) !important;
    font-weight: 500;
    margin: 0 0.5rem;
    transition: color 0.3s ease;
}

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

/* Correción navbar toggler para modo oscuro */
.navbar-toggler {
    border-color: var(--text-color);
}

[data-theme="dark"] .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(230, 237, 243, 0.75)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Toggle Switches */
.switch-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.switch-container i,
.switch-container span {
    color: var(--text-color);
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, #667eea 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: moveBackground 20s linear infinite;
}

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

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-image {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 5px solid white;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    margin-bottom: 2rem;
    object-fit: cover;
    animation: fadeInDown 1s ease forwards, floatContinuous 3s ease-in-out 1s infinite;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--primary-color);
    opacity: 0;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease 0.2s both;
}

.hero .subtitle {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    animation: fadeInUp 1s ease 0.4s both;
}

.hero .btn-download {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    border-radius: 50px;
    background: white;
    color: var(--primary-color);
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    animation: fadeInUp 1s ease 0.6s both;
    border: none;
}

.hero .btn-download:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
    color: var(--primary-color);
}

/* Dropdown del CV */
.dropdown-menu {
    background-color: var(--card-bg);
    border: 1px solid var(--secondary-color);
}

.dropdown-item {
    color: var(--text-color) !important;
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background-color: var(--primary-color);
    color: white !important;
}

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

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

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
    padding-bottom: 1rem;
    color: var(--text-color);
}

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

/* Cards */
.card {
    background: var(--card-bg);
    border: none;
    border-radius: 15px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    height: 100%;
}

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

.card-body {
    padding: 2rem;
}

.card-body p,
.card-body ul li {
    color: var(--text-color);
}

.card-title {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.3rem;
}

/* Experience & Education */
.timeline-item {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 0 0 4px var(--card-bg);
}

.timeline-item::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 12px;
    width: 2px;
    height: calc(100% + 20px);
    background: var(--primary-color);
    opacity: 0.3;
}

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

.company {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.dates {
    color: var(--secondary-color);
    font-size: 0.85rem;
    font-style: italic;
}

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

.skill-name {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.skill-bar {
    height: 10px;
    background: var(--bg-color);
    border-radius: 10px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #667eea);
    border-radius: 10px;
    transition: width 1.5s ease;
    width: 0;
}

.skill-progress.animate {
    width: var(--skill-width);
}

.skill-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.card-body h5 {
    color: var(--text-color);
}

/* Projects */
.project-card {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    height: 300px;
    background: var(--card-bg);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.9), rgba(102, 126, 234, 0.9));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 2rem;
    text-align: center;
    color: white;
}

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

.project-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 4rem;
    color: var(--primary-color);
    opacity: 0.3;
}

/* Contact */
.contact-info {
    font-size: 1.5rem;
    margin: 2rem 0;
}

.contact-info a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

.contact-info a:hover {
    opacity: 0.7;
}

.social-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 2rem;
}

.social-links a {
    font-size: 2rem;
    color: var(--text-color);
    transition: all 0.3s ease;
}

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

/* Footer */
footer {
    background: var(--card-bg);
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid var(--secondary-color);
}

footer p {
    color: var(--text-color);
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-image {
        width: 150px;
        height: 150px;
        font-size: 3rem;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero .subtitle {
        font-size: 1.2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    section {
        padding: 3rem 0;
    }
}

/* Language Selector */
.language-selector {
    background-color: var(--card-bg);
    border: 1px solid var(--secondary-color);
    color: var(--text-color);
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 100px;
}

.language-selector:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    outline: none;
}

.language-selector option {
    background-color: var(--card-bg);
    color: var(--text-color);
}

[data-theme="dark"] .language-selector {
    background-color: var(--card-bg);
    color: var(--text-color);
}

/* About Section */
#about .card {
  max-width: 800px;           /* Limita el ancho del bloque para que no se extienda demasiado */
  margin: 0 auto;             /* Centra la tarjeta */
  padding: 2rem 2.5rem;
  border-radius: 20px;
}

#about .card-body {
  text-align: center;
  line-height: 1.8;
}



#about .card-body p.lead {
  font-weight: 500;
  font-size: 1.15rem;
}

#about {
  background: var(--bg-color);
}

@media (min-width: 992px) {
  #about .card {
    padding: 3rem;
  }
}

#about {
  background: linear-gradient(180deg, rgba(13,110,253,0.03) 0%, rgba(102,126,234,0.05) 100%);
}


/* Typing Effect */
.typing-effect {
    min-height: 2em;
    display: inline-block;
}

.typing-effect .cursor {
    display: inline-block;
    margin-left: 3px;
    animation: blink 0.7s infinite;
    font-weight: 400;
    color: white;
}

@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

#typed-text {
    display: inline-block;
    color: white;
}