/**
 * Skooly Downloads Manager v2.0 - Styles
 * Estilos adicionais e overrides para melhor compatibilidade
 */

/* Garantir que não haja conflitos com tema */
.skooly-downloads-container * {
    box-sizing: border-box;
}

/* Smooth transitions */
.skooly-download-card,
.skooly-download-btn,
.skooly-search-input,
.skooly-category-filter {
    transition: all 0.3s ease;
}

/* Fix para select aparecer com texto visível */
.skooly-category-filter {
    color: #333333 !important;
    background-color: #ffffff !important;
}

.skooly-category-filter option {
    color: #333333 !important;
    background-color: #ffffff !important;
}

/* Focus states melhorados */
.skooly-search-input:focus,
.skooly-category-filter:focus {
    outline: none;
    border-color: #1976D2;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

/* Hover effects */
.skooly-download-card:hover .skooly-card-title {
    color: #1976D2;
}

/* Restricted card hover - orange tint */
.skooly-card-restricted:hover .skooly-card-title {
    color: #E65100;
}

/* Loading state */
.skooly-download-btn.loading {
    position: relative;
    color: transparent;
}

.skooly-download-btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Cooldown pulse animation */
.skooly-btn-cooldown {
    animation: cooldownPulse 2s ease-in-out infinite;
}

@keyframes cooldownPulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Tooltips */
.skooly-tooltip {
    position: relative;
}

.skooly-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    font-size: 12px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    margin-bottom: 5px;
}

.skooly-tooltip:hover::after {
    opacity: 1;
}

/* Empty state */
.skooly-no-downloads {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section separator */
.skooly-section + .skooly-section {
    border-top: 2px solid #e0e0e0;
    padding-top: 30px;
}

/* Section header animations */
.skooly-section-header {
    animation: fadeIn 0.5s ease;
}

/* Print styles */
@media print {
    .skooly-downloads-controls,
    .skooly-download-btn,
    .skooly-access-banner,
    .skooly-restricted-banner {
        display: none !important;
    }
    
    .skooly-download-card {
        page-break-inside: avoid;
    }
    
    .skooly-card-restricted {
        opacity: 1;
        border: 1px solid #ccc;
    }
}

/* Accessibility */
.skooly-download-btn:focus {
    outline: 2px solid #1976D2;
    outline-offset: 2px;
}

.skooly-btn-upgrade-card:focus {
    outline: 2px solid #FF6F00;
    outline-offset: 2px;
}

.skooly-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .skooly-download-card {
        background: #2c2c2c;
        color: #e0e0e0;
    }
    
    .skooly-card-restricted {
        border-color: #B56200;
    }
    
    .skooly-card-title {
        color: #ffffff;
    }
    
    .skooly-card-excerpt {
        color: #b0b0b0;
    }
    
    .skooly-search-input,
    .skooly-category-filter {
        background: #1a1a1a;
        color: #ffffff;
        border-color: #404040;
    }
    
    .skooly-login-banner {
        background: linear-gradient(135deg, #1a2a3a 0%, #1e3a5f 100%);
        border-color: #2a5a8f;
    }
    
    .skooly-restricted-banner {
        background: linear-gradient(135deg, #3a2a1a 0%, #5f3a1e 100%);
        border-color: #8f5a2a;
    }
    
    .skooly-banner-content h3,
    .skooly-banner-content h2,
    .skooly-section-title {
        color: #ffffff;
    }
    
    .skooly-banner-content p,
    .skooly-section-desc {
        color: #b0b0b0;
    }
}

/* Customização para Elementor */
.elementor-widget-text-editor .skooly-downloads-container,
.elementor-widget-shortcode .skooly-downloads-container {
    margin: 0;
}

/* RTL Support */
[dir="rtl"] .skooly-downloads-controls {
    direction: rtl;
}

[dir="rtl"] .skooly-card-categories {
    flex-direction: row-reverse;
}

[dir="rtl"] .skooly-access-banner,
[dir="rtl"] .skooly-restricted-banner {
    direction: rtl;
}
