/* Professional SEO Analyzer Styles */
.seo-analyzer-container {
    max-width: 1200px;
    margin: 2rem auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

/* Header Section */
.seo-analyzer-form {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 3rem 2rem;
    position: relative;
    overflow: hidden;
}

.seo-analyzer-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.form-header {
    text-align: center;
    margin-bottom: 2.5rem;
    position: relative;
    z-index: 1;
}

.form-header h2 {
    color: white;
    margin-bottom: 0.75rem;
    font-size: 2.25rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.form-header h2::before {
    content: '🔍';
    font-size: 2rem;
}

.form-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.125rem;
    margin: 0;
    font-weight: 400;
}

.input-group {
    display: flex;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

#seo-url-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    color: #374151;
}

#seo-url-input:focus {
    outline: none;
    background: white;
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

#seo-analyze-btn {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    position: relative;
    overflow: hidden;
}

#seo-analyze-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

#seo-analyze-btn:hover::before {
    left: 100%;
}

#seo-analyze-btn:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

#seo-analyze-btn:active {
    transform: translateY(0);
}

/* Loading State */
.loading {
    text-align: center;
    padding: 4rem 2rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 1.5rem;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading p {
    color: #64748b;
    font-size: 1.125rem;
    margin: 0;
    font-weight: 500;
}

/* Results Section */
.seo-results {
    background: white;
}

/* Score Overview */
.score-overview {
    background: linear-gradient(135deg, #1e293b, #334155);
    color: white;
    padding: 3rem 2rem;
    text-align: center;
    position: relative;
}

.score-overview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 20%, rgba(59, 130, 246, 0.1), transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(16, 185, 129, 0.1), transparent 50%);
}

.overall-score {
    position: relative;
    z-index: 1;
}

.score-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    border: 3px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.score-circle::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        rgba(16, 185, 129, 0.3) calc(var(--score, 0) * 3.6deg),
        transparent calc(var(--score, 0) * 3.6deg)
    );
    animation: scoreReveal 2s ease-out;
}

@keyframes scoreReveal {
    from { transform: rotate(-90deg); }
    to { transform: rotate(270deg); }
}

.score-number {
    font-size: 3rem;
    font-weight: 800;
    z-index: 1;
    background: linear-gradient(135deg, #10b981, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.score-max {
    font-size: 1.25rem;
    opacity: 0.8;
    z-index: 1;
}

.overall-score h2 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 600;
}

/* Category Scores */
.category-scores {
    padding: 2.5rem 2rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.category-item {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.category-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--category-color, #667eea), var(--category-color-light, #764ba2));
}

.category-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.category-name {
    font-weight: 600;
    color: #374151;
    font-size: 1.125rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.category-score {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--category-color, #667eea);
}

.score-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.score-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--category-color, #667eea), var(--category-color-light, #764ba2));
    border-radius: 4px;
    transition: width 2s ease-out;
    position: relative;
}

.score-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.category-status {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

/* Analysis Tabs */
.analysis-tabs {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.analysis-tabs::-webkit-scrollbar {
    display: none;
}

.tab-nav {
    display: flex;
    min-width: max-content;
}

.tab-button {
    padding: 1.25rem 2rem;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    color: #6b7280;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-size: 1rem;
    position: relative;
}

.tab-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(102, 126, 234, 0.05);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tab-button:hover::before {
    opacity: 1;
}

.tab-button:hover {
    color: #667eea;
}

.tab-button.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.tab-content {
    display: none;
    padding: 2rem;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Analysis Items */
.analysis-section h3 {
    color: #1f2937;
    margin-bottom: 2rem;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.check-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.check-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--status-color, #e5e7eb);
    transition: all 0.3s ease;
}

.check-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.check-item.success {
    --status-color: #10b981;
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.check-item.warning {
    --status-color: #f59e0b;
    background: #fffbeb;
    border-color: #fed7aa;
}

.check-item.error {
    --status-color: #ef4444;
    background: #fef2f2;
    border-color: #fecaca;
}

.check-item.info {
    --status-color: #3b82f6;
    background: #eff6ff;
    border-color: #bfdbfe;
}

.check-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.status-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: bold;
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.check-item.success .status-icon {
    background: #10b981;
    color: white;
}

.check-item.success .status-icon::after {
    content: '✓';
}

.check-item.warning .status-icon {
    background: #f59e0b;
    color: white;
}

.check-item.warning .status-icon::after {
    content: '!';
}

.check-item.error .status-icon {
    background: #ef4444;
    color: white;
}

.check-item.error .status-icon::after {
    content: '×';
}

.check-item.info .status-icon {
    background: #3b82f6;
    color: white;
}

.check-item.info .status-icon::after {
    content: 'i';
}

.check-content {
    flex: 1;
}

.check-title {
    margin: 0 0 0.5rem 0;
    color: #1f2937;
    font-size: 1.125rem;
    font-weight: 600;
}

.check-message {
    margin: 0 0 1rem 0;
    color: #4b5563;
    line-height: 1.6;
}

.check-value {
    background: rgba(0, 0, 0, 0.05);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    color: #374151;
    word-break: break-all;
    margin: 0.5rem 0;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.check-value:hover {
    background: rgba(0, 0, 0, 0.08);
}

.check-value::after {
    content: '📋';
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    opacity: 0.5;
    font-size: 0.75rem;
}

/* Stats and Metrics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.stat-item {
    background: rgba(102, 126, 234, 0.05);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
    display: block;
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* Detail Sections */
.detail-section {
    margin-top: 1.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.detail-header {
    background: #f8fafc;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
    user-select: none;
}

.detail-header:hover {
    background: #f1f5f9;
}

.detail-title {
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-toggle {
    font-size: 1.25rem;
    transition: transform 0.3s ease;
}

.detail-section.expanded .detail-toggle {
    transform: rotate(180deg);
}

.detail-content {
    display: none;
    padding: 1.5rem;
    background: white;
}

.detail-section.expanded .detail-content {
    display: block;
    animation: slideDown 0.3s ease;
}

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

.detail-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.detail-item {
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    border-left: 3px solid #667eea;
    transition: all 0.2s ease;
}

.detail-item:hover {
    background: #f1f5f9;
    transform: translateX(2px);
}

.detail-item:last-child {
    margin-bottom: 0;
}

.item-title {
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

.item-description {
    font-size: 0.875rem;
    color: #6b7280;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* Show More/Less Buttons */
.show-more-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 1rem;
}

.show-more-btn:hover {
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
    transform: translateY(-1px);
}

/* Error States */
.error {
    background: #fef2f2;
    color: #dc2626;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #fecaca;
    margin: 2rem;
}

.error h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.error p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.retry-btn {
    background: #dc2626;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.retry-btn:hover {
    background: #b91c1c;
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .seo-analyzer-container {
        margin: 1rem;
        border-radius: 12px;
    }
    
    .seo-analyzer-form {
        padding: 2rem 1.5rem;
    }
    
    .form-header h2 {
        font-size: 1.75rem;
    }
    
    .input-group {
        flex-direction: column;
        gap: 1rem;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .tab-content {
        padding: 1.5rem;
    }
    
    .check-item {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .score-circle {
        width: 120px;
        height: 120px;
    }
    
    .score-number {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .seo-analyzer-form {
        padding: 1.5rem 1rem;
    }
    
    .form-header h2 {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .check-header {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .status-icon {
        align-self: flex-start;
    }
}

/* Category Color Variables */
.category-item:nth-child(1) {
    --category-color: #3b82f6;
    --category-color-light: #60a5fa;
}

.category-item:nth-child(2) {
    --category-color: #10b981;
    --category-color-light: #34d399;
}

.category-item:nth-child(3) {
    --category-color: #f59e0b;
    --category-color-light: #fbbf24;
}

.category-item:nth-child(4) {
    --category-color: #8b5cf6;
    --category-color-light: #a78bfa;
}

.category-item:nth-child(5) {
    --category-color: #ef4444;
    --category-color-light: #f87171;
}

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

/* Print Styles */
@media print {
    .seo-analyzer-form,
    .tab-nav,
    .show-more-btn {
        display: none;
    }
    
    .tab-content {
        display: block !important;
    }
    
    .seo-analyzer-container {
        box-shadow: none;
        border: 1px solid #000;
    }
}