/* ============================================
   HISTORY PAGE STYLES
   ============================================ */

.history-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.history-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Header */
.history-header {
    text-align: center;
}

.history-title {
    font-size: 2.5rem;
    font-weight:  800;
    color: #1F2937;
}

.dark .history-title {
    color: #EAEAEA;
}

/* Controls */
.history-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(229, 231, 235, 0.8);
    border-radius: 1rem;
}

.dark .history-controls {
    background: rgba(22, 12, 44, 0.8);
    border-color: #2B1A4B;
}

.controls-left,
.controls-right {
    display: flex;
    gap:  0.75rem;
    flex-wrap: wrap;
}

.control-btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.control-btn-select {
    background: rgba(79, 70, 229, 0.1);
    color: #4F46E5;
}

.dark .control-btn-select {
    background: rgba(0, 245, 160, 0.1);
    color: #00F5A0;
}

.control-btn-select:hover {
    background: rgba(79, 70, 229, 0.2);
}

.dark .control-btn-select:hover {
    background: rgba(0, 245, 160, 0.2);
}

.control-btn-danger-outline {
    background: transparent;
    color: #EF4444;
    border: 1px solid #EF4444;
}

.control-btn-danger-outline:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.1);
}

.control-btn-danger {
    background: #EF4444;
    color:  white;
}

.control-btn-danger:hover {
    background: #DC2626;
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.topic-filter {
    padding: 0.625rem 2.5rem 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    background: white;
    border: 1px solid rgba(229, 231, 235, 0.8);
    color: #1F2937;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position:  right 0.5rem center;
    background-repeat: no-repeat;
    background-size:  1.5em 1.5em;
}

.dark .topic-filter {
    background-color: #160C2C;
    border-color: #2B1A4B;
    color: #EAEAEA;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23a092c4' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
}

/* History List */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(229, 231, 235, 0.8);
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.dark .history-item {
    background: rgba(22, 12, 44, 0.8);
    border-color: #2B1A4B;
}

.history-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-color: #4F46E5;
}

.dark .history-item:hover {
    border-color: #00F5A0;
}

.history-checkbox {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    cursor: pointer;
    accent-color: #4F46E5;
}

.dark .history-checkbox {
    accent-color: #00F5A0;
}

.history-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap:  0.5rem;
}

.history-text {
    font-size: 1rem;
    color: #1F2937;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dark .history-text {
    color: #EAEAEA;
}

.history-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.history-topic {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
}

.history-confidence,
.history-time {
    font-size: 0.875rem;
    color: #6B7280;
}

.dark .history-confidence,
.dark .history-time {
    color: #a092c4;
}

.history-delete {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    color: #9CA3AF;
    cursor: pointer;
    transition: all 0.2s;
}

.history-delete:hover {
    color: #EF4444;
    background: rgba(239, 68, 68, 0.1);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #1F2937;
}

.dark .empty-title {
    color: #EAEAEA;
}

.empty-desc {
    font-size: 1rem;
    color: #6B7280;
    margin-bottom: 1.5rem;
}

.dark .empty-desc {
    color: #a092c4;
}

.empty-cta {
    display: inline-flex;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    color:  white;
    background: linear-gradient(135deg, #4F46E5 0%, #22D3EE 100%);
    border-radius: 0.5rem;
    text-decoration: none;
    transition: transform 0.2s;
}

.dark .empty-cta {
    background: linear-gradient(135deg, #00F5A0 0%, #A339FF 100%);
    color: #0B021D;
}

.empty-cta:hover {
    transform:  scale(1.05);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.pagination-btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(229, 231, 235, 0.8);
    color: #1F2937;
    cursor: pointer;
    transition: all 0.2s;
}

.dark .pagination-btn {
    background: rgba(22, 12, 44, 0.8);
    border-color: #2B1A4B;
    color: #EAEAEA;
}

.pagination-btn:hover:not(:disabled) {
    background: rgba(79, 70, 229, 0.1);
    border-color: #4F46E5;
}

.dark .pagination-btn:hover:not(:disabled) {
    background: rgba(0, 245, 160, 0.1);
    border-color: #00F5A0;
}

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

.pagination-info {
    font-size: 0.875rem;
    color: #6B7280;
}

.dark .pagination-info {
    color: #a092c4;
}

/* Topic Colors */
.topic-sports { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.topic-economy { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.topic-entertainment { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.topic-technology { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.topic-education { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.topic-health { background: linear-gradient(135deg, #30cfd0 0%, #330867 100%); }
.topic-law { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); }
.topic-news { background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%); }
.topic-science { background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%); }
.topic-culture { background: linear-gradient(135deg, #ff6e7f 0%, #bfe9ff 100%); }

/* Responsive */
@media (max-width:  768px) {
    .history-main {
        padding: 2rem 1rem;
    }
    
    .history-title {
        font-size: 2rem;
    }
    
    .history-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .controls-left,
    .controls-right {
        width: 100%;
    }
    
    .control-btn {
        flex: 1;
    }
    
    .topic-filter {
        width: 100%;
    }
    
    .history-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .history-delete {
        align-self: flex-end;
    }
}