/* =========================================
           EFECTOS DINÁMICOS Y ANIMADOS CSS
           ========================================= */

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background 0.5s ease, color 0.5s ease;
}

/* Gradient claro por defecto */
body.light {
    background: linear-gradient(-45deg, #0052d4, #4364f7, #6fb1fc, #0f2027);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: #333;
}

/* Gradient modo oscuro */
body.dark {
    background: linear-gradient(-45deg, #020617, #0f172a, #1e293b, #000000);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: #f1f5f9;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Figuras flotantes (Background animado CSS) */
.circles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    margin: 0;
    padding: 0;
    z-index: 0;
    pointer-events: none;
}

.circles li {
    position: absolute;
    display: block;
    list-style: none;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.15);
    animation: animateShapes 25s linear infinite;
    bottom: -150px;
    border-radius: 10px;
}

body.dark .circles li {
    background: rgba(255, 255, 255, 0.05);
}

.circles li:nth-child(1) {
    left: 25%;
    width: 80px;
    height: 80px;
    animation-delay: 0s;
}

.circles li:nth-child(2) {
    left: 10%;
    width: 20px;
    height: 20px;
    animation-delay: 2s;
    animation-duration: 12s;
}

.circles li:nth-child(3) {
    left: 70%;
    width: 20px;
    height: 20px;
    animation-delay: 4s;
}

.circles li:nth-child(4) {
    left: 40%;
    width: 60px;
    height: 60px;
    animation-delay: 0s;
    animation-duration: 18s;
    border-radius: 50%;
}

.circles li:nth-child(5) {
    left: 65%;
    width: 20px;
    height: 20px;
    animation-delay: 0s;
}

.circles li:nth-child(6) {
    left: 75%;
    width: 110px;
    height: 110px;
    animation-delay: 3s;
    border-radius: 50%;
}

.circles li:nth-child(7) {
    left: 35%;
    width: 150px;
    height: 150px;
    animation-delay: 7s;
}

.circles li:nth-child(8) {
    left: 50%;
    width: 25px;
    height: 25px;
    animation-delay: 15s;
    animation-duration: 45s;
}

.circles li:nth-child(9) {
    left: 20%;
    width: 15px;
    height: 15px;
    animation-delay: 2s;
    animation-duration: 35s;
    border-radius: 50%;
}

.circles li:nth-child(10) {
    left: 85%;
    width: 150px;
    height: 150px;
    animation-delay: 0s;
    animation-duration: 11s;
}

@keyframes animateShapes {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
        border-radius: 0;
    }

    100% {
        transform: translateY(-1000px) rotate(720deg);
        opacity: 0;
        border-radius: 50%;
    }
}

/* Glassmorphism Panel */
.glass-panel {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 10;
    position: relative;
    transition: background 0.3s ease, border-color 0.3s ease;
}

body.dark .glass-panel {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Efecto Ribbon (Cinta) CSS */
.ribbon-wrapper {
    position: relative;
    margin: 20px auto 40px;
    width: 80%;
    max-width: 600px;
}

.ribbon {
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    text-align: center;
    background: #e11d48;
    padding: 15px 20px;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.8s ease-out;
}

body.dark .ribbon {
    background: #be123c;
}

.ribbon:before,
.ribbon:after {
    content: "";
    position: absolute;
    bottom: -15px;
    border-top: 15px solid #9f1239;
    z-index: -1;
}

.ribbon:before {
    left: 0;
    border-left: 15px solid transparent;
}

.ribbon:after {
    right: 0;
    border-right: 15px solid transparent;
}

/* Text Animation */
.fade-in-text {
    animation: fadeIn 0.5s ease-in forwards;
}

/* Animación Escalonada para Opciones */
.slide-in-option {
    opacity: 0;
    transform: translateX(-20px);
    animation: slideInRight 0.4s ease-out forwards;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Gráfico Circular de Progreso */
.score-circle {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: conic-gradient(var(--chart-color) var(--percentage), #e5e7eb 0);
    margin: 0 auto;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

body.dark .score-circle {
    background: conic-gradient(var(--chart-color) var(--percentage), #334155 0);
}

.score-circle::before {
    content: "";
    position: absolute;
    width: 130px;
    height: 130px;
    background: white;
    border-radius: 50%;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: background 0.3s;
}

body.dark .score-circle::before {
    background: #1e293b;
}

.score-value {
    position: relative;
    font-size: 2.5rem;
    font-weight: 800;
    color: #1f2937;
}

body.dark .score-value {
    color: #f8fafc;
}

/* Select personalizado compatible con modo oscuro */
body.dark .custom-select {
    background-color: #334155;
    color: #f8fafc;
    border-color: #475569;
}

/* Timers */
.timer-warning {
    color: #ef4444;
    animation: pulse 1s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.drag-item {
    cursor: move;
    user-select: none;
    transition: all 0.2s;
}

.drag-item:active {
    opacity: 0.7;
    transform: scale(0.98);
}

.drop-zone {
    transition: all 0.2s;
}

.dropped-item {
    min-height: 50px;
}