/* Estilos para etiquetas de categoría */
.category-label {
    display: inline-block;
    padding: 0.3em 0.6em;
    border-radius: 0.3em;
    color: #fff;
    font-weight: bold;
    margin-right: 0.5em;
}

/* Botones en la lista de tareas */
.task-controls a.btn {
    margin-left: 0.5em;
}

/* Botones fijos en la parte inferior */
.sticky-buttons {
    position: -webkit-sticky;
    position: sticky;
    bottom: 2rem;
    z-index: 1000;
    padding: 1rem 0;
    display: flex;
    gap: 1em;
    justify-content: center;
}

/* Responsive button sizes */
@media (min-width: 768px) {
    .btn-md-regular {
        padding: 0.375rem 0.75rem;
        font-size: 1rem;
        line-height: 1.5;
    }
}

/* Estilos para los botones de gestión */
.manage-btn {
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    white-space: nowrap;
    margin-bottom: 0.5rem;
}

@media (max-width: 576px) {
    .manage-btn {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 0.6rem 1rem;
        font-size: 1rem;
    }
}

@media (min-width: 577px) and (max-width: 767px) {
    .manage-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
}

/* Mensaje de tarea aleatoria */
#randomTask {
    transition: opacity 0.5s ease;
    opacity: 0;
    font-weight: bold;
    font-size: 1.2em;
    margin-top: 1em;
    padding: 1em;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 0.3em;
}

/* Estilos del tema oscuro */
.theme-dark {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

.theme-dark .navbar {
    background-color: #2d2d2d !important;
}

.theme-dark .navbar-light .navbar-brand,
.theme-dark .navbar-light .navbar-nav .nav-link {
    color: #e0e0e0;
}

.theme-dark .navbar-light .navbar-nav .nav-link:hover {
    color: #ffffff;
}

.theme-dark .card {
    background-color: #2d2d2d;
    border-color: #404040;
}

.theme-dark .card-header {
    background-color: #404040;
    border-bottom-color: #505050;
}

.theme-dark .modal-content {
    background-color: #2d2d2d;
    border-color: #404040;
}

.theme-dark .modal-header {
    border-bottom-color: #404040;
}

.theme-dark .modal-footer {
    border-top-color: #404040;
}

.theme-dark .form-control {
    background-color: #333333;
    border-color: #404040;
    color: #e0e0e0;
}

.theme-dark .form-control:focus {
    background-color: #404040;
    border-color: #505050;
    color: #ffffff;
}

.theme-dark .table {
    color: #e0e0e0;
}

.theme-dark .table td,
.theme-dark .table th {
    border-color: #404040;
}

.theme-dark #randomTask {
    background-color: #2d2d2d;
    border-color: #404040;
}

.theme-dark .btn-outline-secondary {
    color: #e0e0e0;
    border-color: #404040;
}

.theme-dark .btn-outline-secondary:hover {
    background-color: #404040;
    border-color: #505050;
    color: #ffffff;
}

.theme-dark .list-group-item {
    background-color: #2d2d2d;
    border-color: #404040;
    color: #e0e0e0;
}

.theme-dark .input-group-text {
    background-color: #404040;
    border-color: #505050;
    color: #e0e0e0;
}

/* Estilos mejorados para el botón de Roll */
.btn-random {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(37, 117, 252, 0.5);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
    border-radius: 1.5rem;
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-random:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(37, 117, 252, 0.7);
    color: white;
}

/* Efecto de explosión mejorado al hacer clic */
.btn-random:active {
    transform: translateY(1px) scale(0.95);
    box-shadow: 0 4px 15px rgba(37, 117, 252, 0.8);
    background: linear-gradient(135deg, #7825e0 0%, #3a8bff 100%);
    transition: all 0.05s ease;
}

.btn-random:active::after {
    opacity: 1;
    transform: scale(1.5);
    filter: blur(35px);
    transition: all 0.1s ease;
}

.btn-random:active .btn-shine {
    opacity: 0.8;
    animation: flash 0.2s forwards;
}

@keyframes flash {
    0% {
        opacity: 0.3;
        transform: scale(0.9);
    }
    100% {
        opacity: 0.9;
        transform: scale(1.1);
    }
}

/* Efecto de halo luminoso */
.btn-random::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 2rem;
    background: linear-gradient(45deg, #6a11cb, #2575fc, #6a11cb);
    z-index: -2;
    opacity: 0;
    filter: blur(15px);
    transition: opacity 0.3s ease;
}

.btn-random:hover::after {
    opacity: 0.7;
    animation: rotate-halo 3s linear infinite;
}

@keyframes rotate-halo {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Efecto de pulso continuo */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(106, 17, 203, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(106, 17, 203, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(106, 17, 203, 0);
    }
}

.btn-random-pulse {
    animation: pulse 2s infinite;
}

/* Ajustes específicos para móviles */
@media (max-width: 767px) {
    .btn-text {
        font-size: 0.9rem;
    }
    
    .sticky-buttons .btn-random {
        padding: 0.8rem 1.2rem;
        font-size: 0.9rem;
        border-radius: 2rem;
        /* Más visibilidad en móvil */
        transform: scale(1.05);
        box-shadow: 0 8px 25px rgba(37, 117, 252, 0.6);
    }
    
    .btn-logo-icon {
        width: 24px;
        height: 24px;
        margin-right: 8px;
    }
    
    /* Ajustar el efecto de pulso para móviles */
    .btn-random-pulse {
        animation: pulse-mobile 2s infinite;
    }
    
    @keyframes pulse-mobile {
        0% {
            box-shadow: 0 0 0 0 rgba(106, 17, 203, 0.8);
        }
        70% {
            box-shadow: 0 0 0 20px rgba(106, 17, 203, 0);
        }
        100% {
            box-shadow: 0 0 0 0 rgba(106, 17, 203, 0);
        }
    }
}

/* Efecto para el modo oscuro */
@keyframes dark-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(106, 17, 203, 0.9);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(106, 17, 203, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(106, 17, 203, 0);
    }
}

[data-bs-theme="dark"] .btn-random-pulse {
    animation: dark-pulse 2s infinite;
}

/* Clase para cuando se está generando una tarea (se aplica con JS) */
.btn-random-generating {
    background: linear-gradient(135deg, #8a2be2 0%, #4169e1 100%);
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(37, 117, 252, 0.8);
    transition: all 0.3s ease;
}

.btn-random-generating::after {
    opacity: 0.85;
    animation: generate-pulse 0.8s infinite alternate;
}

.btn-random-generating .btn-shine {
    opacity: 1;
    animation: generate-shine 1s infinite;
}

@keyframes generate-pulse {
    0% {
        opacity: 0.6;
        transform: scale(1);
        filter: blur(20px);
    }
    100% {
        opacity: 0.9;
        transform: scale(1.3);
        filter: blur(25px);
    }
}

@keyframes generate-shine {
    0% {
        transform: translateX(-100%) scaleX(0.8);
    }
    100% {
        transform: translateX(100%) scaleX(1.2);
    }
}

/* Ajustes para el modo oscuro */
[data-bs-theme="dark"] .btn-random {
    box-shadow: 0 6px 20px rgba(37, 117, 252, 0.3);
}

[data-bs-theme="dark"] .btn-random:hover {
    box-shadow: 0 8px 25px rgba(37, 117, 252, 0.5);
}

[data-bs-theme="dark"] .btn-random::after {
    filter: blur(20px); /* Halo más difuminado en modo oscuro */
}

[data-bs-theme="dark"] .btn-random-pulse {
    animation: pulse 2s infinite;
}

/* Versión mejorada de la animación del logo */
.btn-logo-icon {
    width: 32px;
    height: 32px;
    margin-right: 12px;
    filter: brightness(0) invert(1);
}

.btn-random:hover .btn-logo-icon {
    animation: roll 0.8s ease;
}

@keyframes roll {
    0% {
        transform: rotate(0deg) scale(1);
    }
    20% {
        transform: rotate(-25deg) scale(1.1);
    }
    40% {
        transform: rotate(20deg) scale(1.1);
    }
    60% {
        transform: rotate(-15deg) scale(1.05);
    }
    80% {
        transform: rotate(10deg) scale(1.05);
    }
    100% {
        transform: rotate(0deg) scale(1);
    }
}

/* Mejora del efecto de destello con gradiente */
.btn-shine {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: translateX(-100%);
    z-index: 1;
    pointer-events: none;
    border-radius: inherit;
    overflow: hidden;
}

.btn-random:hover .btn-shine {
    animation: shine 1.8s infinite;
}

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

/* Estilos para pantallas pequeñas */
@media (max-width: 767px) {
    .task-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .task-header h1 {
        margin-bottom: 1rem;
    }
    
    .task-tags {
        width: 100%;
    }
    
    .task-actions {
        justify-content: flex-start;
        margin-top: 0.5rem;
    }
}

/* Estilos específicos para los toasts */
.toast {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.bg-warning.text-dark {
    color: #212529 !important;
}

.bg-warning-subtle.text-dark {
    background-color: #fff3cd !important;
    color: #212529 !important;
}

.bg-success-subtle.text-dark {
    background-color: #d1e7dd !important;
    color: #212529 !important;
}

/* Ajuste de toasts para modo oscuro */
[data-bs-theme="dark"] .bg-warning.text-dark {
    color: #000 !important;
    font-weight: 600;
}

[data-bs-theme="dark"] .bg-warning-subtle.text-dark {
    background-color: #ffecb5 !important;
    color: #000 !important;
}

[data-bs-theme="dark"] .bg-success-subtle.text-dark {
    background-color: #c3e6cb !important;
    color: #000 !important;
}

/* Estilos para el modal de tareas aleatorias */
.gradient-header {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    border-bottom: none;
    padding: 1rem 1.5rem;
}

.gradient-header .modal-title {
    font-weight: 600;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
}

.gradient-header .fa-dice {
    font-size: 1.2em;
    margin-right: 0.5rem;
    animation: dice-roll 1.5s ease-out;
}

@keyframes dice-roll {
    0% {
        transform: rotate(0deg);
        opacity: 0.5;
    }
    20% {
        transform: rotate(-60deg);
    }
    60% {
        transform: rotate(30deg);
    }
    80% {
        transform: rotate(-15deg);
    }
    100% {
        transform: rotate(0deg);
        opacity: 1;
    }
}

#taskModal .modal-content {
    border: none;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

/* Mejora para el modo oscuro */
[data-bs-theme="dark"] #taskModal .modal-content {
    background-color: #222;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

#taskModal .modal-body {
    padding: 1.5rem;
}
