@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@300;400;500;600;700;800;900&display=swap');

body {
    font-family: 'Rubik', sans-serif;
    background-color: #0f172a;
    color: #e2e8f0;
    scroll-behavior: smooth;
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* Transiciones suaves para todos los elementos en el cambio de tema */
* {
    transition: background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease;
}

/* Preservar transiciones específicas de interacción */
.project-card,
.thumbnail-item,
.animated-square,
button,
a,
input,
textarea {
    transition: all 0.3s ease;
}

/* Tema claro - Estilo Apple */
body.light-theme {
    background-color: #f5f5f7;
    color: #1d1d1f;
}

body.light-theme nav {
    background-color: rgba(251, 251, 253, 0.8) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
    backdrop-filter: saturate(180%) blur(20px);
}

body.light-theme nav a,
body.light-theme nav button {
    color: #424245 !important;
}

body.light-theme nav span {
    color: #1d1d1f !important;
}

body.light-theme #logo-text {
    color: #0071e3 !important;
}

body.light-theme nav a:hover,
body.light-theme nav button:hover {
    color: #1d1d1f !important;
}

body.light-theme .mobile-menu {
    background-color: rgba(251, 251, 253, 0.95) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    backdrop-filter: saturate(180%) blur(20px);
}

body.light-theme header {
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 100%) !important;
}

body.light-theme .animated-square {
    border-color: #0071e3;
    background: rgba(0, 113, 227, 0.08);
}

body.light-theme section {
    background-color: #fbfbfd !important;
}

body.light-theme section:nth-child(even) {
    background-color: #f5f5f7 !important;
}

body.light-theme h1,
body.light-theme h2,
body.light-theme h3,
body.light-theme h4 {
    color: #1d1d1f !important;
}

body.light-theme p {
    color: #424245 !important;
}

body.light-theme .text-blue-100 {
    color: #1d1d1f !important;
}

body.light-theme .project-card {
    background-color: #ffffff !important;
    border: 1px solid #d2d2d7;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-radius: 18px;
}

body.light-theme .project-card:hover {
    background-color: #fafafa !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    border-color: #0071e3;
    transform: translateY(-2px);
}

body.light-theme .project-card p {
    color: #6e6e73 !important;
}

body.light-theme .bg-gray-800,
body.light-theme .bg-gray-900,
body.light-theme .bg-slate-800,
body.light-theme .bg-slate-900 {
    background-color: #ffffff !important;
    border: 1px solid #d2d2d7;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-radius: 12px;
}

body.light-theme .bg-gray-700\/50 {
    background-color: #f5f5f7 !important;
}

body.light-theme input,
body.light-theme textarea {
    background-color: #ffffff !important;
    border-color: #d2d2d7 !important;
    color: #1d1d1f !important;
    border-radius: 12px;
}

body.light-theme input::placeholder,
body.light-theme textarea::placeholder {
    color: #86868b !important;
}

body.light-theme footer {
    background-color: #f5f5f7 !important;
}

body.light-theme .text-gray-300,
body.light-theme .text-gray-400 {
    color: #6e6e73 !important;
}

body.light-theme .text-gray-500 {
    color: #86868b !important;
}

body.light-theme .timeline::before {
    background: #d2d2d7 !important;
}

body.light-theme .timeline-item::before {
    background-color: #0071e3 !important;
    border-color: #ffffff !important;
}

/* Cambiar colores a azul Apple en tema claro */
body.light-theme .bg-indigo-600 {
    background-color: transparent !important;
    border: 1px solid #d2d2d7 !important;
    color: #1d1d1f !important;
}

body.light-theme .border-indigo-500 {
    border-color: #0071e3 !important;
}

body.light-theme .text-indigo-400,
body.light-theme .text-indigo-300 {
    color: #0071e3 !important;
}

body.light-theme .bg-indigo-900\/30 {
    background-color: transparent !important;
    border: 1px solid #d2d2d7 !important;
    color: #6e6e73 !important;
}

body.light-theme .bg-gradient-to-r {
    background: linear-gradient(to right, #1d1d1f, #424245) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
}

body.light-theme .bg-clip-text {
    color: #1d1d1f !important;
    -webkit-text-fill-color: #1d1d1f !important;
}

body.light-theme .text-transparent {
    color: #1d1d1f !important;
    -webkit-text-fill-color: #1d1d1f !important;
}

body.light-theme .hover\:bg-indigo-700:hover,
body.light-theme .hover\:bg-indigo-900\/50:hover {
    background-color: #0077ed !important;
}

body.light-theme .border-2.border-indigo-500 {
    border-color: #0071e3 !important;
}

/* Botones de acción principales - estilo Apple */
body.light-theme a.bg-indigo-600,
body.light-theme button.bg-indigo-600 {
    background-color: #0071e3 !important;
    border-radius: 980px;
    color: #ffffff !important;
    border: none !important;
}

body.light-theme a.bg-indigo-600:hover,
body.light-theme button.bg-indigo-600:hover {
    background-color: #0077ed !important;
}

/* Badges de estado en tarjetas de proyecto */
body.light-theme .project-card .bg-indigo-600 {
    background-color: transparent !important;
    border: 1px solid #d2d2d7 !important;
    color: #1d1d1f !important;
}

/* Botón de LinkedIn y similares */
body.light-theme a.bg-indigo-600.flex,
body.light-theme .bg-indigo-600.hover\:bg-indigo-700 {
    background-color: #0071e3 !important;
    color: #ffffff !important;
}

/* Botón circular de LinkedIn en Connect with me */
body.light-theme a.bg-gray-700,
body.light-theme .bg-gray-700 {
    background-color: #e5e5ea !important;
}

body.light-theme a.bg-gray-700:hover,
body.light-theme a.hover\:bg-indigo-600:hover {
    background-color: #0071e3 !important;
}

body.light-theme a.bg-gray-700 svg,
body.light-theme .bg-gray-700 svg {
    color: #1d1d1f !important;
}

body.light-theme a.bg-gray-700:hover svg {
    color: #ffffff !important;
}

/* Asegurar visibilidad de textos con efectos especiales */
body.light-theme h1 span,
body.light-theme h2 span,
body.light-theme h3 span {
    color: #1d1d1f !important;
    opacity: 1 !important;
    background: none !important;
    -webkit-text-fill-color: #1d1d1f !important;
    text-decoration: none !important;
}

body.light-theme .text-white {
    color: #1d1d1f !important;
}

body.light-theme span.text-white {
    color: #ffffff !important;
}

/* Agregar subrayado azul a títulos en tema claro */
body.light-theme h2 > span.border-b-4,
body.light-theme section h2 span.border-b-4,
body.light-theme span[class*="border-b-4"] {
    color: #1d1d1f !important;
    border-bottom: 4px solid #0071e3 !important;
    border-bottom-width: 4px !important;
    border-bottom-color: #0071e3 !important;
    display: inline-block;
    padding-bottom: 0.5rem;
}

#squares-background {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.animated-square {
    position: absolute;
    border: 2px solid #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    backdrop-filter: blur(2px);
    animation: floatSquare linear infinite;
    transform-origin: center;
}

@keyframes floatSquare {
    0% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-20px) rotate(90deg);
    }
    50% {
        transform: translateY(0) rotate(180deg);
    }
    75% {
        transform: translateY(20px) rotate(270deg);
    }
    100% {
        transform: translateY(0) rotate(360deg);
    }
}

.header-content {
    position: relative;
    z-index: 10;
}

.project-card {
    transition: all 0.3s ease;
    transform: translateY(0);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(59, 130, 246, 0.3);
}

/* Zoom effect for project images */
.project-image img {
    transition: transform 0.7s ease;
    transform: scale(1);
}

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

.skill-bar {
    height: 8px;
    border-radius: 4px;
    background: #1e293b;
    position: relative;
}

.skill-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #3b82f6, #6366f1);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #3b82f6;
    border: 3px solid #1e293b;
}

.timeline {
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 9px;
    top: 0;
    height: 100%;
    width: 2px;
    background: #334155;
}

/* Animation for showing more projects */
.more-projects {
    animation: fadeIn 0.5s ease-out;
}

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

/* Modal styles */
#project-modal {
    transition: opacity 0.3s ease;
}

/* Animación para el modal */
@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

#project-modal:not(.hidden) {
    animation: modalFadeIn 0.3s ease-out;
}

/* Estilos para el contenido del modal */
.modal-content {
    max-height: 80vh;
    overflow-y: auto;
}

/* Asegurar que el iframe de YouTube sea responsive */
.aspect-w-16 {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
}

.aspect-w-16 iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Estilos para la galería de miniaturas */
#modal-gallery {
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #4f46e5 #1e293b;
}

#modal-gallery::-webkit-scrollbar {
    height: 8px;
}

#modal-gallery::-webkit-scrollbar-track {
    background: #1e293b;
    border-radius: 4px;
}

#modal-gallery::-webkit-scrollbar-thumb {
    background: #4f46e5;
    border-radius: 4px;
}

#modal-gallery::-webkit-scrollbar-thumb:hover {
    background: #6366f1;
}

.thumbnail-item {
    transition: all 0.3s ease;
    position: relative;
}

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

.thumbnail-item img {
    transition: opacity 0.3s ease;
}

.thumbnail-item:hover img {
    opacity: 0.8;
}

/* Form styles */
#form-messages {
    transition: all 0.3s ease;
}

/* Input focus styles */
input:focus, textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
}

/* Disabled button style */
button[disabled] {
    opacity: 0.7;
    cursor: not-allowed;
}