/**
 * AI Blog SEO Studio - React Components CSS
 * WordPress Plugin Styles
 */

/* Global Container Styles */
.ai-blog-seo-frontend-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: #333;
    line-height: 1.6;
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.ai-blog-seo-frontend-container * {
    box-sizing: border-box;
}

/* Dark Theme */
.ai-blog-seo-frontend-container[data-theme="dark"] {
    background: #1a1a1a;
    color: #e0e0e0;
}

.ai-blog-seo-frontend-container[data-theme="dark"] input,
.ai-blog-seo-frontend-container[data-theme="dark"] textarea {
    background: #2d2d2d;
    color: #e0e0e0;
    border-color: #404040;
}

.ai-blog-seo-frontend-container[data-theme="dark"] table {
    background: #2d2d2d;
}

.ai-blog-seo-frontend-container[data-theme="dark"] th,
.ai-blog-seo-frontend-container[data-theme="dark"] td {
    border-color: #404040;
}

.ai-blog-seo-frontend-container[data-theme="dark"] .analysis-results,
.ai-blog-seo-frontend-container[data-theme="dark"] .keyword-card {
    background: #2d2d2d;
    border-color: #404040;
}

/* Loading States */
.ai-blog-seo-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    min-height: 300px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
}

.ai-blog-seo-loading-spinner {
    margin-bottom: 30px;
    position: relative;
}

.ai-blog-seo-spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #ffffff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: ai-blog-seo-spin 1s linear infinite;
    margin: 0 auto 20px;
}

.ai-blog-seo-loading-text h3 {
    margin: 0 0 10px;
    font-size: 24px;
    font-weight: 600;
}

.ai-blog-seo-loading-text p {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
}

/* Error States */
.ai-blog-seo-error {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    margin: 20px;
}

.ai-blog-seo-error-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.8;
}

.ai-blog-seo-error h3 {
    color: #dc3545;
    margin: 0 0 15px;
    font-size: 24px;
}

.ai-blog-seo-error p {
    color: #6c757d;
    margin: 0 0 20px;
    font-size: 16px;
}

.ai-blog-seo-retry-btn {
    background: linear-gradient(45deg, #007cba, #0073aa);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 123, 186, 0.3);
}

.ai-blog-seo-retry-btn:hover {
    background: linear-gradient(45deg, #005a87, #005177);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 123, 186, 0.4);
}

/* Error Message Component */
.ai-blog-seo-error-message {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border: 1px solid #fca5a5;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.1);
}

.ai-blog-seo-error-message h4 {
    color: #dc2626;
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 600;
}

.ai-blog-seo-error-message p {
    color: #991b1b;
    margin: 0 0 15px;
    line-height: 1.5;
}

/* Spinner Animation */
@keyframes ai-blog-seo-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Pulse Animation */
@keyframes ai-blog-seo-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Slide In Animation */
@keyframes ai-blog-seo-slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Component Specific Styles */

/* Blog Analyzer */
.ai-blog-seo-analyzer textarea {
    width: 100%;
    min-height: 300px;
    padding: 20px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: #ffffff;
}

.ai-blog-seo-analyzer textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 123, 186, 0.1);
}

.ai-blog-seo-analyzer button {
    background: linear-gradient(45deg, #3498db, #9b59b6);
    color: white;
    border: none;
    padding: 15px 35px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.ai-blog-seo-analyzer button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.ai-blog-seo-analyzer button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Content Editor */
.ai-blog-seo-editor textarea {
    width: 100%;
    min-height: 250px;
    padding: 20px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: #ffffff;
}

.ai-blog-seo-editor textarea:focus {
    outline: none;
    border-color: #9b59b6;
    box-shadow: 0 0 0 3px rgba(155, 89, 182, 0.1);
}

.ai-blog-seo-editor button {
    background: linear-gradient(45deg, #9b59b6, #e91e63);
    color: white;
    border: none;
    padding: 15px 35px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.3);
}

.ai-blog-seo-editor button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(155, 89, 182, 0.4);
}

.ai-blog-seo-editor button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Keyword Research */
.ai-blog-seo-keywords input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 14px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: #ffffff;
}

.ai-blog-seo-keywords input:focus {
    outline: none;
    border-color: #ff6b35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.ai-blog-seo-keywords button {
    background: linear-gradient(45deg, #ff6b35, #f7931e);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.ai-blog-seo-keywords button:hover:not(:disabled) {
    background: linear-gradient(45deg, #e55a2b, #e0841a);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.ai-blog-seo-keywords button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Tables */
.ai-blog-seo-keywords table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    animation: ai-blog-seo-slideIn 0.5s ease;
}

.ai-blog-seo-keywords th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    font-size: 14px;
}

.ai-blog-seo-keywords td {
    padding: 15px 12px;
    border-bottom: 1px solid #f1f3f4;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.ai-blog-seo-keywords tbody tr:hover td {
    background-color: #f8f9fa;
}

/* Analysis Results */
.analysis-results {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #dee2e6;
    border-radius: 15px;
    padding: 30px;
    margin-top: 30px;
    animation: ai-blog-seo-slideIn 0.6s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.analysis-results h3 {
    color: #2c3e50;
    margin: 0 0 25px;
    text-align: center;
    font-size: 28px;
    font-weight: 700;
}

/* Score Cards Grid */
.score-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.score-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.score-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.score-number {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.score-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #e8f4f8 0%, #f0f8ff 100%);
    border-radius: 10px;
}

.stat-item {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #555;
    font-weight: 500;
}

/* List Sections */
.suggestions-section,
.strengths-section,
.issues-section {
    margin-bottom: 20px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
}

.section-title.suggestions { color: #2980b9; }
.section-title.strengths { color: #27ae60; }
.section-title.issues { color: #e74c3c; }

.section-list {
    padding-left: 0;
    list-style: none;
}

.section-list li {
    padding: 8px 15px;
    margin-bottom: 6px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.4;
    position: relative;
    padding-left: 35px;
}

.suggestions-section .section-list li {
    background: rgba(41, 128, 185, 0.1);
    color: #2980b9;
}

.strengths-section .section-list li {
    background: rgba(39, 174, 96, 0.1);
    color: #27ae60;
}

.issues-section .section-list li {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

.section-list li:before {
    content: "•";
    position: absolute;
    left: 15px;
    top: 8px;
    font-weight: bold;
    font-size: 16px;
}

/* Dashboard Feature Cards */
.ai-blog-seo-dashboard {
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 15px;
    min-height: 600px;
}

.dashboard-header {
    text-align: center;
    margin-bottom: 50px;
}

.dashboard-title {
    font-size: 48px;
    font-weight: 800;
    background: linear-gradient(45deg, #3498db, #9b59b6, #e91e63);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    animation: ai-blog-seo-gradient 3s ease infinite;
}

.dashboard-subtitle {
    font-size: 20px;
    color: #7f8c8d;
    margin-bottom: 30px;
    font-weight: 500;
}

.dashboard-stats {
    display: flex;
    justify-content: center;
    gap: 50px;
    flex-wrap: wrap;
}

.dashboard-stat {
    text-align: center;
}

.dashboard-stat-number {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 5px;
}

.dashboard-stat-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* Feature Cards Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.feature-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.feature-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.feature-card:before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
    transition: all 0.6s;
    opacity: 0;
}

.feature-card:hover:before {
    animation: ai-blog-seo-shine 0.6s ease-in-out;
}

.feature-icon {
    font-size: 56px;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    transition: all 0.3s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1);
}

.feature-title {
    font-size: 22px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
}

.feature-subtitle {
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 14px;
}

.feature-stats {
    color: white;
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.feature-description {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

/* CTA Section */
.cta-section {
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px;
    border-radius: 20px;
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.cta-title {
    margin: 0 0 15px;
    font-size: 32px;
    font-weight: 700;
}

.cta-description {
    margin: 0 0 30px;
    opacity: 0.95;
    font-size: 18px;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.cta-button {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.25);
    color: white;
    padding: 15px 30px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.cta-button:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Animations */
@keyframes ai-blog-seo-gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes ai-blog-seo-shine {
    0% { opacity: 0; left: -100%; }
    50% { opacity: 1; }
    100% { opacity: 0; left: 100%; }
}

/* Keyword Cards */
.keyword-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.keyword-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.keyword-card h4 {
    margin: 0 0 15px;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
}

.keyword-stats {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #666;
}

/* Badges */
.competition-badge {
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.competition-low {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.competition-medium {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #faeeba;
}

.competition-high {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ai-blog-seo-frontend-container {
        margin: 10px;
    }
    
    .dashboard-title {
        font-size: 36px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .feature-card {
        padding: 25px 20px;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .cta-button {
        width: 100%;
        max-width: 300px;
    }
    
    .score-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .ai-blog-seo-keywords table {
        font-size: 12px;
    }
    
    .ai-blog-seo-keywords th,
    .ai-blog-seo-keywords td {
        padding: 10px 8px;
    }
}

@media (max-width: 480px) {
    .dashboard-title {
        font-size: 28px;
    }
    
    .dashboard-subtitle {
        font-size: 16px;
    }
    
    .dashboard-stats {
        gap: 30px;
    }
    
    .feature-card {
        padding: 20px 15px;
    }
    
    .feature-icon {
        font-size: 48px;
    }
    
    .feature-title {
        font-size: 20px;
    }
    
    .cta-title {
        font-size: 24px;
    }
    
    .score-grid {
        grid-template-columns: 1fr;
    }
}

/* Print Styles */
@media print {
    .ai-blog-seo-frontend-container {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .feature-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .cta-section {
        background: #f5f5f5 !important;
        color: #333 !important;
    }
    
    button {
        display: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .ai-blog-seo-frontend-container {
        border: 2px solid #000;
    }
    
    .feature-card {
        border: 2px solid #333;
    }
    
    .cta-section {
        background: #000 !important;
        color: #fff !important;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Styles for Accessibility */
button:focus,
input:focus,
textarea:focus {
    outline: 3px solid #005fcc;
    outline-offset: 2px;
}

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