/* History page styling built on top of dashboard glass UI */

.history-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    padding: 28px 30px;
}

.history-hero h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.history-hero p {
    color: var(--text-secondary);
    max-width: 520px;
    font-size: 0.95rem;
}

.history-meta {
    display: flex;
    gap: 16px;
}

.history-meta-card {
    padding: 16px 20px;
    border-radius: var(--border-radius-md);
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.16);
    min-width: 150px;
}

.light-mode .history-meta-card {
    background: rgba(255, 255, 255, 0.9);
}

.meta-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-secondary);
}

.meta-value {
    display: block;
    margin-top: 6px;
    font-size: 1.4rem;
    font-weight: 600;
}

.history-controls {
    padding: 26px 28px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.history-controls-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.history-controls-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.history-controls-header p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.history-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.history-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.45);
}

.light-mode .history-search {
    background: rgba(255, 255, 255, 0.9);
}

.history-search i {
    color: var(--text-secondary);
}

.history-search .search-input {
    border: none;
    background: transparent;
    padding: 0;
    width: 220px;
    color: var(--text-primary);
}

.history-search .search-input:focus {
    outline: none;
}

.history-danger,
.history-ghost {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.history-danger:disabled,
.history-ghost:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.history-danger {
    background: rgba(248, 113, 113, 0.18);
    border: 1px solid rgba(248, 113, 113, 0.28);
    color: #fecaca;
}

.history-danger:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(248, 113, 113, 0.25);
}

.history-ghost {
    background: rgba(91, 124, 250, 0.14);
    border: 1px solid rgba(91, 124, 250, 0.26);
    color: #c7d2fe;
}

.history-ghost:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(91, 124, 250, 0.25);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(15, 23, 42, 0.45);
    border-radius: var(--border-radius-md);
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.light-mode .history-item {
    background: rgba(255, 255, 255, 0.9);
}

.history-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-soft);
}

.history-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, rgba(91, 124, 250, 0.9), rgba(56, 189, 248, 0.8));
    border-radius: var(--border-radius-md) 0 0 var(--border-radius-md);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.history-item:hover::before {
    opacity: 1;
}

.history-checkbox {
    accent-color: var(--primary);
}

.history-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.history-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.history-details {
    display: flex;
    gap: 18px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.history-detail {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.action-btn {
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: transparent;
    color: var(--text-primary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(91, 124, 250, 0.18);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 12px;
}

.pagination-btn {
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.4);
    color: var(--text-primary);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.pagination-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Modal overrides */
.modal-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-details {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 160px;
}

.detail-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-secondary);
}

.detail-value {
    font-size: 0.95rem;
    font-weight: 600;
}

.transcription-content {
    max-height: 360px;
    overflow-y: auto;
    padding: 16px;
    border-radius: var(--border-radius-sm);
    background: rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.light-mode .transcription-content {
    background: rgba(255, 255, 255, 0.9);
}

.transcription-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: pre-wrap;
    line-height: 1.6;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-footer .btn-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Empty state */
.empty-state {
    padding: 40px;
    text-align: center;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 2rem;
    margin-bottom: 12px;
    color: var(--primary);
}

.history-progress {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 16px;
    padding: 16px;
    display: none;
    flex-direction: column;
    gap: 10px;
}

.light-mode .history-progress {
    background: rgba(255, 255, 255, 0.92);
}

.history-progress-track {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.18);
    overflow: hidden;
}

.history-progress-fill {
    width: 0;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-dark), var(--accent));
    border-radius: 999px;
    transition: width 0.2s ease;
}

.history-progress-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .history-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .history-meta {
        width: 100%;
        gap: 12px;
        flex-wrap: wrap;
    }

    .history-meta-card {
        flex: 1;
        min-width: 140px;
    }

    .history-controls-header {
        flex-direction: column;
        align-items: stretch;
    }

    .history-actions {
        justify-content: flex-start;
    }

    .history-search .search-input {
        width: 100%;
    }

    .history-actions-item {
        flex-wrap: wrap;
    }
}

@media (max-width: 576px) {
    .history-meta {
        flex-direction: column;
    }

    .history-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .history-controls {
        padding: 24px;
        gap: 18px;
    }

    .history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .history-details {
        flex-direction: column;
        gap: 6px;
    }

    .history-actions-item {
        width: 100%;
        justify-content: flex-start;
    }

    .pagination {
        flex-direction: column;
        gap: 10px;
    }

    .modal-footer {
        flex-direction: column;
        align-items: stretch;
    }
}