/* Translation History Styles */

/* History Toggle Button */
.history-toggle-btn {
    position: fixed;
    top: 10px;
    right: 10px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    z-index: 100;
}

.history-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.history-toggle-btn:active {
    transform: scale(0.95);
}

/* History Panel */
.history-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100vh;
    background: #ffffff;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.history-panel.open {
    right: 0;
}

/* History Header */
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.history-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-header h3 i {
    font-size: 22px;
}

.history-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.2s ease;
}

.history-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* History Body */
.history-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f8f9fa;
}

/* History Empty State */
.history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #888;
    text-align: center;
    padding: 40px 20px;
}

.history-empty i {
    font-size: 64px;
    color: #ddd;
    margin-bottom: 15px;
}

.history-empty p {
    font-size: 18px;
    font-weight: 500;
    margin: 0 0 8px 0;
    color: #666;
}

.history-empty span {
    font-size: 14px;
    color: #999;
}

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

/* History Item */
.history-item {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    border: 1px solid #eee;
}

.history-item:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.history-langs {
    font-size: 12px;
    font-weight: 600;
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    padding: 4px 10px;
    border-radius: 20px;
}

.history-time {
    font-size: 11px;
    color: #999;
}

/* History Content */
.history-content {
    margin-bottom: 12px;
}

.history-source {
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.history-translated {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
    padding-left: 10px;
    border-left: 3px solid #667eea;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* History Actions */
.history-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.history-use-btn,
.history-delete-btn {
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.history-use-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.history-use-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.history-delete-btn {
    background: #f8f9fa;
    color: #dc3545;
    border: 1px solid #eee;
}

.history-delete-btn:hover {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

/* History Footer */
.history-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    background: white;
}

.history-clear-btn {
    width: 100%;
    padding: 12px;
    border: 1px solid #dc3545;
    background: transparent;
    color: #dc3545;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.history-clear-btn:hover {
    background: #dc3545;
    color: white;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .history-panel {
        width: 100%;
        right: -100%;
    }

    .history-toggle-btn {
        top: auto;
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
        font-size: 26px;
    }
}

/* Scrollbar Styling */
.history-body::-webkit-scrollbar {
    width: 6px;
}

.history-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.history-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.history-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Overlay for mobile */
@media (max-width: 768px) {
    .history-panel.open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }
}
