/* generador-hash — estilos específicos */

/* Textarea de entrada */
.hash-input-wrap {
    border: 2px solid var(--border, #e2e8f0);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    transition: border-color 0.18s, box-shadow 0.18s;
    margin-bottom: 0.75rem;
}

.hash-input-wrap:focus-within {
    border-color: var(--primary, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.hash-textarea {
    width: 100%;
    min-height: 120px;
    border: none;
    outline: none;
    background: transparent;
    font-family: 'Ubuntu', monospace, sans-serif;
    font-size: 0.92rem;
    color: var(--text, #1e293b);
    padding: 0.85rem 1rem;
    resize: vertical;
    box-sizing: border-box;
    line-height: 1.6;
}

.hash-textarea::placeholder {
    color: var(--text-muted, #cbd5e1);
}

.textarea-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0.85rem 0.5rem;
    border-top: 1px solid var(--border, #e2e8f0);
    background: var(--bg-alt, #f8fafc);
}

.char-count {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.72rem;
    color: var(--text-muted, #94a3b8);
}

.btn-clear-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted, #94a3b8);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: color 0.14s;
}

.btn-clear-text:hover {
    color: #ef4444;
}

/* Opciones de algoritm */
.algo-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.algo-btn {
    padding: 0.35rem 0.9rem;
    border: 2px solid var(--border, #e2e8f0);
    border-radius: 20px;
    background: transparent;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted, #64748b);
    cursor: pointer;
    transition: all 0.14s;
    white-space: nowrap;
}

.algo-btn:hover {
    border-color: var(--primary, #2563eb);
    color: var(--primary, #2563eb);
}

.algo-btn.active {
    border-color: var(--primary, #2563eb);
    background: var(--primary, #2563eb);
    color: #fff;
}

/* Opciones de formato */
.format-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.format-row label {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.format-toggle {
    display: flex;
    border: 2px solid var(--border, #e2e8f0);
    border-radius: 8px;
    overflow: hidden;
}

.fmt-btn {
    padding: 0.3rem 0.75rem;
    border: none;
    background: transparent;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted, #64748b);
    cursor: pointer;
    transition: background 0.13s, color 0.13s;
}

.fmt-btn:not(:last-child) {
    border-right: 1px solid var(--border, #e2e8f0);
}

.fmt-btn.active {
    background: var(--primary, #2563eb);
    color: #fff;
}

/* Cuadrícula de resultados de hash */
.hash-results-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.hash-result-card {
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.15s;
}

.hash-result-card:hover {
    border-color: var(--primary, #2563eb);
}

.hash-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0.9rem;
    background: var(--bg-alt, #f8fafc);
    border-bottom: 1px solid var(--border, #e2e8f0);
}

.hash-algo-tag {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hash-algo-name {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text, #1e293b);
}

.hash-bits {
    font-size: 0.67rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 6px;
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bits-md5 {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.bits-sha1 {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.bits-sha256 {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
}

.bits-sha512 {
    background: rgba(139, 92, 246, 0.1);
    color: #7c3aed;
}

.hash-security-tag {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 6px;
    font-family: 'Montserrat', sans-serif;
}

.sec-broken {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.sec-weak {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.sec-strong {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.hash-copy-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted, #64748b);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.2rem 0;
    transition: color 0.14s;
}

.hash-copy-btn:hover {
    color: var(--primary, #2563eb);
}

.hash-copy-btn.copied {
    color: #16a34a;
}

.hash-value-wrap {
    padding: 0.75rem 0.9rem;
    background: #fff;
}

.hash-value {
    font-family: 'Ubuntu', monospace, sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text, #1e293b);
    word-break: break-all;
    line-height: 1.65;
    letter-spacing: 0.03em;
}

.hash-value.loading {
    color: var(--text-muted, #94a3b8);
    font-style: italic;
    font-weight: 400;
}

/* Comparador de hashes */
.compare-block {
    background: var(--bg-alt, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.compare-block h3 {
    font-size: 0.82rem;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    color: var(--text-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.compare-block h3 i {
    color: var(--primary, #2563eb);
}

.compare-input {
    width: 100%;
    border: 2px solid var(--border, #e2e8f0);
    border-radius: 8px;
    padding: 0.6rem 0.85rem;
    font-family: 'Ubuntu', monospace, sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text, #1e293b);
    background: #fff;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.18s;
    margin-bottom: 0.65rem;
}

.compare-input:focus {
    border-color: var(--primary, #2563eb);
}

.compare-result {
    display: none;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.85rem;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
}

.compare-result.match {
    display: flex;
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.compare-result.no-match {
    display: flex;
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Tabla de desglose */
.breakdown-box {
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.breakdown-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.1rem;
    background: var(--primary, #2563eb);
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
}

.breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1.1rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.84rem;
}

.breakdown-row:last-child {
    border-bottom: none;
}

.breakdown-row:nth-child(even) {
    background: var(--bg-alt, #f8fafc);
}

.breakdown-row .br-label {
    color: var(--text-muted, #64748b);
    font-weight: 600;
}

.breakdown-row .br-val {
    font-family: 'Ubuntu', monospace, sans-serif;
    font-weight: 700;
    color: var(--text, #1e293b);
    text-align: right;
}

/* Tabla de referencia */
.ref-table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border, #e2e8f0);
}

.ref-table-wrap table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
    min-width: 480px;
}

.ref-table-wrap thead {
    background: var(--primary, #2563eb);
    color: #fff;
}

.ref-table-wrap thead th {
    padding: 0.65rem 1rem;
    text-align: left;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    white-space: nowrap;
}

.ref-table-wrap tbody tr:nth-child(even) {
    background: var(--bg-alt, #f8fafc);
}

.ref-table-wrap tbody tr:hover {
    background: rgba(37, 99, 235, 0.04);
}

.ref-table-wrap tbody td {
    padding: 0.55rem 1rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
    font-family: 'Montserrat', sans-serif;
    color: var(--text, #1e293b);
    vertical-align: middle;
}

.ref-table-wrap tbody tr:last-child td {
    border-bottom: none;
}

.status-pill {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.15rem 0.55rem;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
}

.pill-broken {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.pill-weak {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.pill-strong {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

/* Responsive */
@media (max-width: 600px) {
    .format-row {
        gap: 0.65rem;
    }
}