/**
 * Metalzone AI Translator - Frontend Styles
 */

/* Language Switcher */
.mat-language-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    transition: all 0.3s ease;
}

.mat-switcher-container {
    position: relative;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    overflow: hidden;
    min-width: 200px;
    transition: all 0.3s ease;
}

.mat-switcher-container:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    transform: translateY(-2px);
}

.mat-current-language {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s ease;
}

.mat-current-language:hover {
    background: #e9ecef;
}

.mat-language-flag {
    width: 20px;
    height: 15px;
    margin-right: 8px;
    border-radius: 2px;
    background-size: cover;
    background-position: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    flex-shrink: 0;
}

/* Flag styles using CSS gradients and patterns */
.mat-flag-en {
    background: linear-gradient(135deg, #012169 0%, #012169 25%, #fff 25%, #fff 50%, #C8102E 50%, #C8102E 75%, #fff 75%, #fff 100%);
    position: relative;
}

.mat-flag-en::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 40%, #C8102E 40%, #C8102E 60%, transparent 60%);
}

.mat-flag-fr {
    background: linear-gradient(90deg, #ED2939 0%, #ED2939 33.33%, #fff 33.33%, #fff 66.66%, #002395 66.66%, #002395 100%);
}

.mat-flag-es {
    background: linear-gradient(180deg, #c60b1e 0%, #c60b1e 25%, #ffc400 25%, #ffc400 75%, #c60b1e 75%, #c60b1e 100%);
}

.mat-flag-de {
    background: linear-gradient(180deg, #000 0%, #000 33.33%, #d00 33.33%, #d00 66.66%, #ffce00 66.66%, #ffce00 100%);
}

.mat-flag-it {
    background: linear-gradient(90deg, #009246 0%, #009246 33.33%, #fff 33.33%, #fff 66.66%, #ce2b37 66.66%, #ce2b37 100%);
}

.mat-flag-pt {
    background: linear-gradient(90deg, #f00 0%, #f00 40%, #060 40%, #060 100%);
    position: relative;
}

.mat-flag-pt::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 20%;
    width: 12px;
    height: 12px;
    background: #ff0;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.mat-language-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mat-switcher-arrow {
    font-size: 10px;
    color: #666;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.mat-switcher-container:hover .mat-switcher-arrow {
    transform: rotate(180deg);
}

.mat-language-dropdown {
    display: none;
    background: #fff;
    animation: mat-dropdown-fade 0.2s ease;
}

.mat-switcher-container:hover .mat-language-dropdown {
    display: block;
}

.mat-language-option {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.mat-language-option:last-child {
    border-bottom: none;
}

.mat-language-option:hover {
    background: #f8f9fa;
    text-decoration: none;
    color: #333;
    transform: translateX(5px);
}

.mat-language-option.mat-has-translation {
    background: #e8f5e8;
    border-left: 3px solid #28a745;
}

.mat-language-option.mat-has-translation:hover {
    background: #d4edda;
}

.mat-language-option.mat-no-translation {
    opacity: 0.7;
    background: #f8f9fa;
}

.mat-language-option.mat-no-translation:hover {
    opacity: 1;
    background: #e9ecef;
}

.mat-translation-status {
    font-size: 11px;
    color: #666;
    margin-left: auto;
    font-style: italic;
    flex-shrink: 0;
}

.mat-source-language {
    background: #fff3cd;
    border-top: 2px solid #ffeaa7;
    font-weight: 500;
}

.mat-source-language:hover {
    background: #ffeaa7;
}

/* Language Suggestion */
.mat-language-suggestion {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10001;
    padding: 15px;
    max-width: 300px;
    animation: mat-suggestion-slide 0.3s ease;
}

.mat-suggestion-content p {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #333;
}

.mat-suggestion-buttons {
    display: flex;
    gap: 10px;
}

.mat-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.mat-btn-primary {
    background: #0073aa;
    color: #fff;
}

.mat-btn-primary:hover {
    background: #005a87;
    transform: translateY(-1px);
}

.mat-btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.mat-btn-secondary:hover {
    background: #e0e0e0;
    transform: translateY(-1px);
}

/* Translation Preview */
.mat-translation-preview {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-width: 300px;
    animation: mat-preview-fade 0.3s ease;
    position: absolute;
    z-index: 10000;
}

.mat-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.mat-preview-title {
    font-weight: bold;
    font-size: 14px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 10px;
}

.mat-preview-close {
    cursor: pointer;
    font-size: 18px;
    color: #666;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.mat-preview-close:hover {
    color: #333;
}

.mat-preview-content {
    padding: 15px;
    font-size: 13px;
    line-height: 1.4;
    color: #555;
    max-height: 200px;
    overflow-y: auto;
}

/* Loading States */
.mat-loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.mat-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: mat-spin 1s linear infinite;
}

/* Animations */
@keyframes mat-dropdown-fade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes mat-suggestion-slide {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes mat-preview-fade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .mat-language-switcher {
        top: 10px;
        right: 10px;
    }
    
    .mat-switcher-container {
        min-width: 160px;
    }
    
    .mat-language-name {
        font-size: 13px;
    }
    
    .mat-language-option {
        padding: 8px 12px;
    }
    
    .mat-language-suggestion {
        left: 10px;
        right: 10px;
        transform: none;
        max-width: none;
    }
    
    .mat-suggestion-buttons {
        flex-direction: column;
    }
    
    .mat-btn {
        text-align: center;
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .mat-language-switcher {
        position: relative;
        top: auto;
        right: auto;
        margin: 10px;
        float: right;
    }
    
    .mat-switcher-container {
        min-width: 140px;
    }
    
    .mat-language-flag {
        width: 16px;
        height: 12px;
    }
    
    .mat-language-name {
        font-size: 12px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .mat-switcher-container {
        border: 2px solid #000;
    }
    
    .mat-language-option {
        border-bottom: 1px solid #000;
    }
    
    .mat-language-option:hover {
        background: #000;
        color: #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .mat-switcher-container,
    .mat-language-option,
    .mat-btn {
        transition: none;
    }
    
    .mat-switcher-container:hover {
        transform: none;
    }
    
    .mat-language-option:hover {
        transform: none;
    }
    
    .mat-btn:hover {
        transform: none;
    }
}

/* Print styles */
@media print {
    .mat-language-switcher {
        display: none;
    }
}

/* Focus styles for accessibility */
.mat-language-option:focus {
    outline: 2px solid #0073aa;
    outline-offset: -2px;
}

.mat-btn:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .mat-switcher-container {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .mat-current-language {
        background: #4a5568;
        border-color: #718096;
    }
    
    .mat-current-language:hover {
        background: #718096;
    }
    
    .mat-language-name {
        color: #e2e8f0;
    }
    
    .mat-language-option {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .mat-language-option:hover {
        background: #4a5568;
    }
    
    .mat-language-option.mat-has-translation {
        background: #22543d;
        border-color: #38a169;
    }
    
    .mat-language-option.mat-has-translation:hover {
        background: #276749;
    }
    
    .mat-translation-status {
        color: #a0aec0;
    }
} 