/* SEO Widget Selector - Enhanced Styles */

/* Container */
.seo-widget-selector-container {
    animation: fadeIn 0.5s ease-in;
}

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

/* Search functionality */
.tool-hidden {
    display: none !important;
}

.group-hidden {
    display: none !important;
}

/* Tool Cards */
.seo-tool-card {
    position: relative;
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
}

.seo-tool-card:hover {
    transform: translateY(-4px);
    border-color: transparent;
}

.seo-tool-card .line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Widget Wrapper (for sidebar widgets) */
.seo-checker-pro-widget-wrapper {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
}

.seo-widget-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1rem;
    text-align: center;
    position: relative;
    padding-bottom: 0.75rem;
}

.seo-widget-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: linear-gradient(to right, #3b82f6, #8b5cf6);
    border-radius: 2px;
}

/* Responsive adjustments for widget context */
.widget .seo-widget-selector-container {
    padding: 0;
}

.widget .seo-tool-card {
    min-height: auto;
}

.widget .grid {
    grid-template-columns: 1fr;
    gap: 1rem;
}

/* Stats cards in widget */
.widget .grid.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.widget .text-3xl {
    font-size: 1.5rem;
}

.widget .text-4xl {
    font-size: 1.75rem;
}

.widget .text-2xl {
    font-size: 1.25rem;
}

.widget .p-6 {
    padding: 1rem;
}

.widget .mb-10 {
    margin-bottom: 1.5rem;
}

.widget .mb-12 {
    margin-bottom: 2rem;
}

/* Loading states */
.seo-tool-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

.seo-tool-card.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Group headers */
.seo-widget-group {
    position: relative;
}

.seo-widget-group::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, #e5e7eb, transparent);
}

.seo-widget-group:first-child::before {
    display: none;
}

/* Tool status badges */
.seo-tool-card .bg-opacity-20 {
    backdrop-filter: blur(4px);
}

/* Hover effects for buttons */
.seo-tool-card a:not(.cursor-not-allowed) {
    position: relative;
    overflow: hidden;
}

.seo-tool-card a:not(.cursor-not-allowed)::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.seo-tool-card a:not(.cursor-not-allowed):hover::before {
    width: 300px;
    height: 300px;
}

/* Search input styling */
#tool-search {
    transition: all 0.3s ease;
}

#tool-search:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* No results message */
.no-results-message {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .seo-widget-selector-container {
        padding: 1rem;
    }
    
    .grid.grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    .text-4xl {
        font-size: 2rem;
    }
    
    .seo-tool-card {
        max-width: 100%;
    }
}

/* Print styles */
@media print {
    .seo-widget-selector-container {
        box-shadow: none;
    }
    
    .seo-tool-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }
    
    #tool-search,
    .seo-tool-card a,
    .seo-tool-card button {
        display: none;
    }
}

/* Dark mode support (if theme supports it) */
@media (prefers-color-scheme: dark) {
    .seo-checker-pro-widget-wrapper {
        background: #1e293b;
        border-color: #334155;
    }
    
    .seo-widget-title {
        color: #f1f5f9;
    }
    
    .seo-tool-card {
        background: #1e293b;
        border-color: #334155;
    }
    
    .seo-tool-card h3 {
        color: #f1f5f9;
    }
    
    .seo-tool-card p {
        color: #cbd5e1;
    }
    
    #tool-search {
        background: #1e293b;
        border-color: #334155;
        color: #f1f5f9;
    }
    
    #tool-search::placeholder {
        color: #64748b;
    }
}

/* Accessibility improvements */
.seo-tool-card a:focus,
.seo-tool-card button:focus,
#tool-search:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Skip link for keyboard navigation */
.skip-to-tools {
    position: absolute;
    top: -40px;
    left: 0;
    background: #3b82f6;
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 0 0 4px 0;
}

.skip-to-tools:focus {
    top: 0;
}

/* Custom scrollbar */
.seo-widget-selector-container::-webkit-scrollbar {
    width: 8px;
}

.seo-widget-selector-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.seo-widget-selector-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.seo-widget-selector-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
