/**
 * Frontend CSS for AI Translator Plugin
 * Translation display box styles
 * 
 * @package AI_Translator_Post_Manager
 * @since 1.0.0
 */

/* Translation Box Container */
.ai-translator-frontend-box {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    line-height: 1.4;
}

/* Toggle Button */
.ai-translator-toggle {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 16px;
    border-radius: 25px 0 0 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    min-width: 120px;
    position: relative;
    overflow: hidden;
}

.ai-translator-toggle:hover {
    transform: translateX(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.ai-translator-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.ai-translator-toggle:hover::before {
    left: 100%;
}

.ai-translator-icon {
    font-size: 18px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.ai-translator-text {
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-translator-count {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    margin-left: auto;
}

/* Translation Panel */
.ai-translator-panel {
    position: absolute;
    right: 100%;
    top: 0;
    width: 320px;
    background: white;
    border-radius: 15px 0 0 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateX(20px);
    transition: all 0.3s ease;
    border: 1px solid #e1e5e9;
    overflow: hidden;
}

.ai-translator-frontend-box.active .ai-translator-panel {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

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

.ai-translator-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.ai-translator-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.ai-translator-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Panel Content */
.ai-translator-content {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.ai-translator-content::-webkit-scrollbar {
    width: 6px;
}

.ai-translator-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.ai-translator-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.ai-translator-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Current Language */
.ai-translator-current {
    margin-bottom: 20px;
}

.ai-translator-current .ai-translator-item {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border-radius: 10px;
    padding: 12px 15px;
}

/* Language Lists */
.ai-translator-list {
    margin-bottom: 20px;
}

.ai-translator-list:last-child {
    margin-bottom: 0;
}

.ai-translator-list h5 {
    margin: 0 0 10px 0;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Language Items */
.ai-translator-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s ease;
    margin-bottom: 8px;
    border: 1px solid #e1e5e9;
    position: relative;
    overflow: hidden;
}

.ai-translator-item:last-child {
    margin-bottom: 0;
}

.ai-translator-item:hover {
    background: #f8f9fa;
    border-color: #667eea;
    transform: translateX(5px);
    text-decoration: none;
    color: #333;
}

.ai-translator-item.current {
    border: none;
    pointer-events: none;
}

.ai-translator-item.original {
    border-color: #28a745;
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
    color: white;
}

.ai-translator-item.original:hover {
    background: linear-gradient(135deg, #4e9a2a 0%, #96d4b8 100%);
    color: white;
}

/* Language Flag */
.ai-translator-flag {
    font-size: 20px;
    flex-shrink: 0;
}

/* Language Name */
.ai-translator-name {
    flex: 1;
    font-weight: 500;
}

/* Badges */
.ai-translator-badge {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-translator-item:not(.current):not(.original) .ai-translator-badge {
    background: #667eea;
    color: white;
}

/* Arrow */
.ai-translator-arrow {
    font-size: 16px;
    color: #667eea;
    font-weight: bold;
    transition: transform 0.2s ease;
}

.ai-translator-item:hover .ai-translator-arrow {
    transform: translateX(3px);
}

/* Panel Footer */
.ai-translator-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e1e5e9;
    text-align: center;
}

.ai-translator-footer small {
    color: #666;
    font-size: 11px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ai-translator-frontend-box {
        right: 10px;
    }
    
    .ai-translator-panel {
        width: 280px;
    }
    
    .ai-translator-toggle {
        padding: 10px 12px;
        min-width: 100px;
    }
    
    .ai-translator-text {
        display: none;
    }
}

@media (max-width: 480px) {
    .ai-translator-frontend-box {
        position: fixed;
        top: auto;
        bottom: 20px;
        right: 20px;
        transform: none;
    }
    
    .ai-translator-panel {
        position: fixed;
        bottom: 70px;
        right: 20px;
        left: 20px;
        width: auto;
        border-radius: 15px;
    }
    
    .ai-translator-toggle {
        border-radius: 50%;
        width: 50px;
        height: 50px;
        padding: 0;
        min-width: auto;
        justify-content: center;
    }
    
    .ai-translator-count {
        position: absolute;
        top: -5px;
        right: -5px;
        margin: 0;
    }
}

/* Animation for mobile panel */
@media (max-width: 480px) {
    .ai-translator-panel {
        transform: translateY(20px);
    }
    
    .ai-translator-frontend-box.active .ai-translator-panel {
        transform: translateY(0);
    }
}

/* Loading State */
.ai-translator-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #666;
}

.ai-translator-loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #e1e5e9;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Accessibility */
.ai-translator-item:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.ai-translator-toggle:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .ai-translator-panel {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .ai-translator-item {
        background: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .ai-translator-item:hover {
        background: #718096;
        color: #e2e8f0;
    }
    
    .ai-translator-footer {
        background: #4a5568;
        border-color: #718096;
    }
    
    .ai-translator-list h5 {
        color: #a0aec0;
    }
}

/* Print styles */
@media print {
    .ai-translator-frontend-box {
        display: none !important;
    }
}