/******************************************************************************
 *
 * File...........: history.css
 * Project........: EnigmaJS
 * Description....: Estilos para el panel de historial de cifrados (E0032)
 *
 ******************************************************************************/

/* Botón de acción en el panel de mensajes */
.message-actions {
    grid-column: span 2;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
}

#btnRecordHistory {
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: 600;
    padding: 10px 20px;
    border: 1px solid #4a4030;
    border-radius: 6px;
    background: linear-gradient(180deg, #2b251d 0%, #1e1a14 100%);
    color: var(--color-gold);
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
}

#btnRecordHistory:hover {
    background: linear-gradient(180deg, #3d3529 0%, #29241c 100%);
    border-color: var(--color-gold);
    color: var(--color-gold-hover);
    box-shadow: 0 0 10px rgba(223, 178, 71, 0.25);
}

.btn-secondary {
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: 600;
    padding: 10px 20px;
    border: 1px solid #3d3530;
    border-radius: 6px;
    background: linear-gradient(180deg, #221d1a 0%, #181411 100%);
    color: #9e8e7e;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: linear-gradient(180deg, #2e2520 0%, #221c18 100%);
    border-color: #cc4444;
    color: #e07070;
    box-shadow: 0 0 10px rgba(180, 60, 60, 0.2);
}

/* Panel de historial */
#historyPanel {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 15px;
    border-bottom: 1px solid #2d2a27;
    padding-bottom: 10px;
}

.history-title {
    font-family: var(--font-title);
    font-size: 20px;
    font-weight: 700;
    color: var(--color-title);
}

.history-buttons {
    display: flex;
    gap: 10px;
}

.history-btn {
    font-family: var(--font-main);
    font-size: 11px;
    font-weight: 500;
    padding: 6px 12px;
    border: 1px solid #3d3a36;
    border-radius: 4px;
    background: #252321;
    color: var(--color-text-dim);
    cursor: pointer;
    transition: all 0.2s;
}

.history-btn:hover {
    background: #33302d;
    color: white;
}

.history-btn-clear:hover {
    border-color: var(--color-accent);
    color: #ff6b6b;
}

.history-btn-export:hover {
    border-color: var(--color-gold);
    color: var(--color-gold);
}

/* Tabla del historial */
.history-table-container {
    width: 100%;
    overflow-x: auto;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.history-table th {
    font-weight: 600;
    color: var(--color-title);
    border-bottom: 2px solid #3d3a36;
    padding: 10px 12px;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 1px;
}

.history-table td {
    padding: 12px;
    border-bottom: 1px solid #2d2a27;
    color: var(--color-text);
    vertical-align: middle;
}

.history-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Celdas específicas */
.cell-time {
    color: var(--color-text-dim);
    font-family: monospace;
    white-space: nowrap;
}

.cell-config {
    font-family: monospace;
    font-size: 12px;
    color: #bfa070;
    max-width: 250px;
    word-break: break-all;
}

.cell-text {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cell-actions {
    text-align: center;
    width: 50px;
}

.btn-delete-row {
    background: transparent;
    border: none;
    color: var(--color-accent);
    cursor: pointer;
    font-size: 14px;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
    padding: 4px;
}

.btn-delete-row:hover {
    opacity: 1;
    transform: scale(1.1);
}

.history-empty {
    text-align: center;
    color: var(--color-text-dim);
    font-style: italic;
    padding: 30px 0;
}

/* ─── Botón Ver Detalle ─────────────────────────────────────────────────────── */
.btn-view-row {
    background: transparent;
    border: none;
    color: #7a9fbf;
    cursor: pointer;
    font-size: 15px;
    opacity: 0.65;
    transition: opacity 0.2s, transform 0.2s, color 0.2s;
    padding: 4px;
}

.btn-view-row:hover {
    opacity: 1;
    color: #a8d0f0;
    transform: scale(1.15);
}

/* ─── Modal de Detalle de Historial ─────────────────────────────────────────── */
.history-detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(4px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: hdFadeIn 0.18s ease;
}

@keyframes hdFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.history-detail-modal {
    background: linear-gradient(160deg, #23201c 0%, #1a1712 100%);
    border: 1px solid #4a4030;
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,200,80,0.07);
    width: min(660px, 92vw);
    max-height: 88vh;
    overflow-y: auto;
    padding: 32px 36px 28px;
    animation: hdSlideIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

@keyframes hdSlideIn {
    from { opacity: 0; transform: translateY(-18px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)     scale(1);    }
}

.history-detail-modal .hd-close-btn {
    position: absolute;
    top: 14px;
    right: 18px;
    background: transparent;
    border: none;
    color: #6a6055;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
    padding: 4px 6px;
}

.history-detail-modal .hd-close-btn:hover {
    color: #e07070;
}

.hd-title {
    font-family: var(--font-title);
    font-size: 17px;
    font-weight: 700;
    color: var(--color-gold);
    letter-spacing: 1px;
    margin-bottom: 22px;
    text-transform: uppercase;
    border-bottom: 1px solid #3a3530;
    padding-bottom: 12px;
}

.hd-fields {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 14px 18px;
    margin-bottom: 28px;
}

.hd-label {
    font-family: var(--font-main);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #7a7060;
    padding-top: 3px;
    align-self: start;
}

.hd-value {
    font-family: monospace;
    font-size: 13px;
    color: var(--color-text);
    background: rgba(255,255,255,0.03);
    border: 1px solid #332f2a;
    border-radius: 6px;
    padding: 8px 12px;
    word-break: break-all;
    line-height: 1.5;
}

.hd-value.hd-config {
    color: #bfa070;
    font-size: 12px;
}

.hd-value.hd-message {
    color: #d0e8ff;
    font-size: 14px;
    letter-spacing: 1.5px;
    word-break: break-word;
}

.hd-value.hd-cipher {
    color: #a8f0c0;
    font-size: 14px;
    letter-spacing: 1.5px;
    word-break: break-word;
}

.hd-divider {
    border: none;
    border-top: 1px solid #2d2a27;
    margin: 4px 0 20px;
}

.hd-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.hd-btn {
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: 600;
    padding: 10px 22px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hd-btn-insert {
    background: linear-gradient(180deg, #1e3a28 0%, #142a1c 100%);
    border: 1px solid #2e6e44;
    color: #60d090;
    box-shadow: 0 4px 12px rgba(0, 150, 80, 0.2);
}

.hd-btn-insert:hover {
    background: linear-gradient(180deg, #2a4e38 0%, #1a3828 100%);
    border-color: #40c070;
    color: #80f0b0;
    box-shadow: 0 0 14px rgba(0, 200, 100, 0.3);
}

.hd-btn-close {
    background: linear-gradient(180deg, #2b251d 0%, #1e1a14 100%);
    border: 1px solid #4a4030;
    color: #9e8e7e;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.hd-btn-close:hover {
    background: linear-gradient(180deg, #3d3529 0%, #29241c 100%);
    border-color: var(--color-gold);
    color: var(--color-gold);
}
