/* Estilos específicos para el modo de agente */

/* Botón de regreso fijo */
.fixed-back-button {
    position: fixed;
    top: 20px;
    left: 20px;
    background-color: rgba(15, 25, 35, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-family: 'Tungsten', sans-serif;
    font-size: 1.2rem;
    letter-spacing: 1px;
    z-index: 1000;
    transition: all 0.3s ease;
    border: 1px solid #ff4655;
}

.fixed-back-button:hover {
    background-color: #ff4655;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Footer */
.footer {
    position: fixed;
    bottom: 10px;
    left: 10px;
    font-size: 1.3rem;
    color: white;
    background-color: transparent;
    z-index: 10;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

.footer a {
    color: var(--primary-color, #ff4655);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: var(--primary-hover-color, #ff7b86);
}

/* Fondo específico para el modo de agente */
.agent-mode-background {
    background-image: url('../src/backgrounds/agents-mode.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

.agent-mode-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 0;
}

.agent-game-content {
    position: relative;
    z-index: 1;
    background-color: rgba(15, 25, 35, 0.8);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    max-width: 800px;
    width: 100%;
}

/* Estilos para el input de búsqueda */
.agent-search-container {
    width: 100%;
    margin-bottom: 2rem;
}

.agent-search-input {
    width: 100%;
    padding: 1rem;
    font-size: 1.2rem;
    background-color: rgba(255, 255, 255, 0.9);
    border: 2px solid #ff4655;
    border-radius: 4px;
    color: #0f1923;
    font-family: 'Tungsten', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    outline: none;
    transition: all 0.3s ease;
}

.agent-search-input::placeholder {
    color: #888;
    opacity: 0.8;
}

.agent-search-input:focus {
    border-color: #ff4655;
    box-shadow: 0 0 10px rgba(255, 70, 85, 0.5);
}

/* Estilos para la tabla de agentes */
.agent-table-container {
    width: 100%;
    overflow: hidden;
    border-radius: 4px;
}

.agent-table-header {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background-color: #ff4655;
    color: white;
    padding: 0.75rem 0;
    font-weight: bold;
    text-transform: uppercase;
    font-family: 'Tungsten', sans-serif;
    letter-spacing: 1px;
}

.header-cell {
    padding: 0.5rem 1rem;
    text-align: center;
    font-size: 1.2rem;
}

.agent-table-body {
    max-height: 500px;
    overflow-y: auto;
}

.agent-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s ease;
    animation: rowAppear 0.5s ease-out forwards;
}

.agent-row {
    background-color: rgba(15, 25, 35, 0.9) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.agent-row:hover {
    background-color: rgba(30, 40, 50, 0.9) !important;
    cursor: pointer;
}

.agent-row.selected {
    background-color: rgba(255, 70, 85, 0.5);
}

.agent-cell {
    padding: 0.75rem 1rem;
    text-align: center;
    color: white;
    font-family: 'Tungsten', sans-serif;
    letter-spacing: 1px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    gap: 8px;
    opacity: 0;
    transform: translateY(10px);
    animation: cellReveal 0.6s ease-out forwards;
}

/* Estilos para el icono del rol */
.role-icon {
    height: 24px;
    width: 24px;
    vertical-align: middle;
    margin-right: 5px;
}

/* Estilos para el contenedor de fecha y flecha */
.date-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Estilos para los iconos de flecha */
.arrow-icon {
    font-size: 1.2rem;
    font-weight: bold;
    color: #ff4655;
}

/* Animaciones para la aparición de filas y celdas */
@keyframes rowAppear {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes cellReveal {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Aplicar retraso a cada celda para que aparezcan secuencialmente */
.agent-cell:nth-child(1) {
    animation-delay: 0.1s;
}

.agent-cell:nth-child(2) {
    animation-delay: 0.2s;
}

.agent-cell:nth-child(3) {
    animation-delay: 0.3s;
}

.agent-cell:nth-child(4) {
    animation-delay: 0.4s;
}

/* Estilos para las coincidencias y no coincidencias */
.agent-cell.match {
    color: #4caf50 !important;
}

.agent-cell.no-match {
    color: #ff4655 !important;
}

/* Estilos para el autocompletado */
.autocomplete-container {
    background-color: rgba(15, 25, 35, 0.95);
    border: 1px solid #ff4655;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
}

.autocomplete-item {
    padding: 10px;
    cursor: pointer;
    color: white;
    font-family: 'Tungsten', sans-serif;
    letter-spacing: 1px;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s ease;
}

.autocomplete-item:hover {
    background-color: rgba(255, 70, 85, 0.3);
}

/* Estilos para el modal de éxito */
.success-modal {
    background-color: var(--secondary-color, #0f1923);
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    padding: 2rem;
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    color: white;
}

/* Estilos para el mensaje de cooldown dentro del modal de éxito */
.success-modal .cooldown-message {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    background-color: rgba(0, 0, 0, 0.5);
    margin: 10px auto;
    width: 90%;
    padding: 10px;
    border-radius: 4px;
}

.modal-overlay.active .success-modal {
    transform: translateY(0);
}

.success-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--primary-color, #ff4655);
    padding-bottom: 0.5rem;
}

.success-modal-title {
    color: var(--primary-color, #ff4655);
    font-size: 3rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
    text-shadow: 0 0 5px rgba(255, 70, 85, 0.3);
}

.success-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.success-message {
    text-align: center;
}

.success-message p {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

#success-agent-name {
    color: var(--primary-color, #ff4655);
    font-size: 2.5rem;
    margin: 0.5rem 0;
    text-transform: uppercase;
}

.success-agent-image {
    width: 150px;
    height: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1rem 0;
}

#success-agent-icon {
    max-width: 100%;
    max-height: 100%;
}

.success-close-button {
    background-color: var(--primary-color, #ff4655);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.8rem 1.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    text-transform: uppercase;
    margin-top: 1rem;
    transition: background-color 0.3s ease, transform 0.1s ease;
}

.success-close-button:hover {
    background-color: var(--primary-hover-color, #ff7b86);
}

.success-close-button:active {
    transform: scale(0.98);
}

/* Responsive */
@media (max-width: 768px) {
    .agent-game-content {
        padding: 1rem;
    }
    
    .agent-table-header,
    .agent-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .header-cell,
    .agent-cell {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
    
    .agent-search-input {
        padding: 0.75rem;
        font-size: 1rem;
    }
    
    .success-modal {
        width: 95%;
        padding: 1.5rem;
    }
    
    .success-modal-title {
        font-size: 2.5rem;
    }
    
    #success-agent-name {
        font-size: 2rem;
    }
    
    .success-message p {
        font-size: 1.3rem;
    }
    
    .success-close-button {
        font-size: 1.3rem;
        padding: 0.7rem 1.2rem;
    }
}

@media (max-width: 480px) {
    .agent-table-header,
    .agent-row {
        grid-template-columns: 1fr;
    }
    
    .agent-cell {
        text-align: left;
        padding-left: 1rem;
    }
    
    .header-cell {
        display: none;
    }
}