/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

:root {
    --off-color: #374151; /* gray-200 */
    --on-color: #0369a1; /* sky-700 */
    --onHandle-color: #ffffff;
    --offHandle-color: #ffffff;
}

/* Animations */
@keyframes slideIn {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

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

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.animate-slide-in {
    animation: slideIn 0.5s ease-out forwards;
}

.animate-slide-out {
    animation: slideOut 0.5s ease-in forwards;
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

.animate-scale-in {
    animation: scaleIn 0.2s ease-out forwards;
}

.animate-shimmer {
    animation: shimmer 2s infinite;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-gradient {
    background-size: 200% 200%;
    animation: gradient-shift 3s ease infinite;
}

/* Glassmorphism */
.glass {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.glass-light {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.glass-dark {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Card hover effects */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow:
        0 20px 25px -5px rgb(0 0 0 / 0.1),
        0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* Text gradient utility */
.text-gradient {
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@media (prefers-color-scheme: dark) {
    .text-gradient {
        background: linear-gradient(135deg, #60a5fa 0%, #818cf8 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
}

.dark .text-gradient {
    background: linear-gradient(135deg, #60a5fa 0%, #818cf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Shadow with color */
.shadow-primary {
    box-shadow:
        0 10px 15px -3px rgba(59, 130, 246, 0.25),
        0 4px 6px -4px rgba(59, 130, 246, 0.1);
}

.shadow-success {
    box-shadow:
        0 10px 15px -3px rgba(16, 185, 129, 0.25),
        0 4px 6px -4px rgba(16, 185, 129, 0.1);
}

/* Progress bar shimmer effect */
.progress-shimmer {
    position: relative;
    overflow: hidden;
}

.progress-shimmer::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    animation: shimmer 2s infinite;
}

/* Focus States for Accessibility */
*:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-radius: 4px;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Skip to main content link for screen readers */
.skip-to-main {
    position: absolute;
    left: -9999px;
    z-index: 999;
}

.skip-to-main:focus {
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    padding: 1rem 2rem;
    background: #3b82f6;
    color: white;
    border-radius: 0 0 0.5rem 0.5rem;
    text-decoration: none;
}

.exercise-notes {
    h1,
    h2,
    h3 {
        margin-top: 1em;
    }
    p {
        margin-bottom: 1em;
    }
    ul,
    ol {
        margin-left: 2em;
    }
    code {
        background: #f4f4f4;
        padding: 2px 4px;
        border-radius: 3px;
    }
}

.gradient-button {
    background-size: 200% 100%;
    background-image: linear-gradient(
        to right,
        #1d4ed8 0%,
        /* Azul más oscuro */ #60a5fa 35%,
        /* Azul claro */ #2563eb 50%,
        /* Azul medio */ #1e40af 65%,
        /* Azul muy oscuro */ #3b82f6 100% /* Azul estándar */
    );
    background-position: 0% 0%;
    transition:
        background-position 0.6s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.3s ease;
}

.gradient-button:hover {
    background-position: 100% 0%;
    box-shadow:
        0 10px 20px rgba(37, 99, 235, 0.4),
        /* Sombra más intensa */ 0 6px 6px rgba(37, 99, 235, 0.3);
    transform: translateY(-1px);
}

/* Variante con brillo adicional */
.gradient-button-shine {
    position: relative;
    overflow: hidden;
}

.gradient-button-shine::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0) 40%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0) 60%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(45deg);
    transition: transform 0.8s ease;
    opacity: 0;
}

.gradient-button-shine:hover::after {
    transform: rotate(45deg) translate(100%, 100%);
    opacity: 1;
}
