/* Voz do Fato - Professional Features Styles */
/* Estilos para funcionalidades profissionais - NÃO altera código existente */

/* Loader Profissional */
.professional-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-content {
    background: var(--bg-secondary);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    text-align: center;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-left: 4px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-content p {
    margin: 0;
    font-weight: 500;
    color: var(--text-secondary);
}

body.loading {
    overflow: hidden;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    min-width: 300px;
    background: var(--bg-secondary);
    border-radius: 8px;
    box-shadow: 0 4px 15px var(--shadow);
    border-left: 4px solid;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    pointer-events: all;
}

.toast.toast-show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    border-left-color: #10b981;
}

.toast-error {
    border-left-color: #ef4444;
}

.toast-warning {
    border-left-color: #f59e0b;
}

.toast-info {
    border-left-color: #3b82f6;
}

.toast-content {
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-icon {
    font-size: 18px;
    font-weight: bold;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
}

.toast-success .toast-icon {
    background: #10b981;
}

.toast-error .toast-icon {
    background: #ef4444;
}

.toast-warning .toast-icon {
    background: #f59e0b;
}

.toast-info .toast-icon {
    background: #3b82f6;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-primary);
}

.toast-close {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.toast-close:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

/* Breadcrumbs */
.breadcrumbs {
    background: var(--bg-secondary);
    padding: 10px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    border: 1px solid var(--border-color);
}

.breadcrumb-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-link:hover {
    color: var(--accent-color);
}

.breadcrumb-separator {
    color: var(--text-meta);
    margin: 0 8px;
}

.breadcrumb-current {
    color: var(--text-primary);
    font-weight: 500;
}

/* Comments System */
.comments-section {
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 25px;
    margin-top: 30px;
    border: 1px solid var(--border-color);
}

.comments-section h4 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1.2em;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 10px;
}

.comments-list {
    margin-bottom: 25px;
}

.comment-item {
    background: var(--bg-primary);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 3px solid var(--accent-color);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 14px;
}

.comment-header strong {
    color: var(--text-primary);
}

.comment-date {
    color: var(--text-meta);
    font-size: 12px;
}

.comment-content {
    color: var(--text-secondary);
    line-height: 1.5;
    font-size: 14px;
}

.comment-form {
    display: grid;
    gap: 15px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.comment-form input,
.comment-form textarea {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.1);
}

.comment-form textarea {
    resize: vertical;
    min-height: 100px;
}

.comment-form button {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    justify-self: start;
}

.comment-form button:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.2);
}

/* Melhorias na Newsletter */
.newsletter-enhanced {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    color: white;
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.newsletter-enhanced::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: rotate(45deg);
}

.newsletter-enhanced h3 {
    position: relative;
    z-index: 1;
}

.newsletter-enhanced p {
    position: relative;
    z-index: 1;
    opacity: 0.9;
}

.newsletter-form {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
}

.newsletter-form input {
    padding: 12px 15px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    font-size: 14px;
}

.newsletter-form button {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.newsletter-form button:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* Analytics Dashboard (para administradores) */
.analytics-dashboard {
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 25px;
    border: 1px solid var(--border-color);
    margin: 20px 0;
}

.analytics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--accent-color);
}

.analytics-header h3 {
    color: var(--text-primary);
    font-size: 1.3em;
}

.analytics-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: var(--bg-primary);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
    text-align: center;
}

.stat-number {
    font-size: 2em;
    font-weight: bold;
    color: var(--accent-color);
    display: block;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 5px;
}

/* Lazy Loading Styles */
img[data-src] {
    filter: blur(5px);
    transition: filter 0.3s;
}

img.loaded {
    filter: none;
}

/* SEO Meta Info Display (para desenvolvedores) */
.seo-info {
    position: fixed;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px;
    border-radius: 5px;
    font-size: 12px;
    display: none;
    z-index: 1000;
}

.seo-info.show {
    display: block;
}

/* Performance Indicators */
.performance-indicator {
    position: fixed;
    top: 10px;
    left: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 12px;
    color: var(--text-secondary);
    z-index: 1000;
    display: none;
}

.performance-indicator.show {
    display: block;
}

.performance-good {
    border-color: #10b981;
    color: #10b981;
}

.performance-medium {
    border-color: #f59e0b;
    color: #f59e0b;
}

.performance-poor {
    border-color: #ef4444;
    color: #ef4444;
}

/* Enhanced Search Results */
.search-results {
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid var(--border-color);
}

.search-results h3 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1.2em;
}

.search-result-item {
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-title {
    color: #1e40af;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 5px;
    cursor: pointer;
}

.search-result-title:hover {
    color: var(--accent-color);
}

.search-result-snippet {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 5px;
}

.search-result-meta {
    font-size: 12px;
    color: var(--text-meta);
}

.search-highlight {
    background: #fef3c7;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

[data-theme="dark"] .search-highlight {
    background: #451a03;
    color: #fbbf24;
}

/* Social Media Share Buttons */
.share-buttons {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.share-button {
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.share-facebook {
    background: #1877f2;
}

.share-twitter {
    background: #1da1f2;
}

.share-whatsapp {
    background: #25d366;
}

.share-email {
    background: #6b7280;
}

.share-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Reading Progress Bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--accent-color);
    z-index: 10000;
    transition: width 0.1s ease;
}

/* Print Styles Enhancement */
@media print {
    .professional-loader,
    .toast-container,
    .share-buttons,
    .comments-section,
    .analytics-dashboard {
        display: none !important;
    }
    
    .breadcrumbs {
        background: transparent;
        border: 1px solid #ccc;
        margin-bottom: 20px;
    }
    
    .comment-item {
        border: 1px solid #ccc;
        margin-bottom: 10px;
    }
}

/* High Contrast Mode Enhancement */
@media (prefers-contrast: high) {
    .toast {
        border: 2px solid currentColor;
    }
    
    .spinner {
        border-width: 6px;
        border-left-width: 6px;
    }
    
    .comment-item {
        border-left-width: 5px;
    }
}

/* Reduced Motion Enhancement */
@media (prefers-reduced-motion: reduce) {
    .spinner {
        animation: none;
        border-left-color: var(--accent-color);
        border-radius: 0;
    }
    
    .toast {
        transition: none;
        opacity: 1;
        transform: none;
    }
    
    .share-button:hover,
    .comment-form button:hover,
    .newsletter-form button:hover {
        transform: none;
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .toast-container {
        right: 10px;
        left: 10px;
    }
    
    .toast {
        min-width: auto;
        width: 100%;
    }
    
    .analytics-stats {
        grid-template-columns: 1fr;
    }
    
    .breadcrumbs {
        padding: 8px 15px;
        font-size: 12px;
    }
    
    .breadcrumb-separator {
        margin: 0 5px;
    }
    
    .comments-section {
        padding: 20px 15px;
    }
    
    .comment-form {
        gap: 12px;
    }
    
    .share-buttons {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .share-button {
        flex: 1;
        justify-content: center;
        min-width: calc(50% - 4px);
    }
    
    .loader-content {
        margin: 0 20px;
        padding: 25px 20px;
    }
}

@media (max-width: 480px) {
    .breadcrumbs {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .comments-section {
        padding: 15px 10px;
    }
    
    .share-button {
        min-width: 100%;
        justify-content: center;
    }
    
    .analytics-dashboard {
        padding: 20px 15px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-number {
        font-size: 1.8em;
    }
    
    .loader-content {
        margin: 0 15px;
        padding: 20px 15px;
    }
    
    .spinner {
        width: 35px;
        height: 35px;
    }
}

/* Dark Mode Specific Adjustments */
[data-theme="dark"] .newsletter-enhanced {
    background: linear-gradient(135deg, #0f172a, #1e293b);
}

[data-theme="dark"] .newsletter-form input {
    background: rgba(255, 255, 255, 0.9);
    color: #1f2937;
}

[data-theme="dark"] .search-result-title {
    color: #60a5fa;
}

[data-theme="dark"] .stat-number {
    color: #fbbf24;
}

/* Accessibility Enhancements */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--accent-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 10001;
}

.skip-link:focus {
    top: 6px;
}

/* Focus Indicators */
.comment-form input:focus,
.comment-form textarea:focus,
.newsletter-form input:focus,
.share-button:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Performance Optimization Classes */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Animation Performance */
@media (prefers-reduced-motion: no-preference) {
    .toast.toast-show {
        animation: slideInRight 0.3s ease-out;
    }
    
    .spinner {
        animation: spin 1s linear infinite;
    }
    
    @keyframes slideInRight {
        from {
            opacity: 0;
            transform: translateX(100%);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }
}