/* SEO Ranking Analyzer - Frontend Styles */

:root {
    --seo-primary-color: #4F46E5;
    --seo-primary-dark: #4338CA;
    --seo-primary-light: #818CF8;
    --seo-bg-light: #F9FAFB;
    --seo-border-color: #E5E7EB;
    --seo-text-primary: #111827;
    --seo-text-secondary: #6B7280;
    --seo-success: #10B981;
    --seo-error: #EF4444;
    --seo-warning: #F59E0B;
}

.seo-ranking-wrapper {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Form Container */
.seo-ranking-form-container {
    animation: fadeIn 0.6s ease-in-out;
}

.seo-ranking-form-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    max-width: 600px;
    margin: 0 auto;
}

.seo-ranking-logo {
    text-align: center;
    margin-bottom: 30px;
}

.seo-ranking-logo img {
    max-width: 200px;
    height: auto;
}

.seo-ranking-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--seo-text-primary);
    text-align: center;
    margin-bottom: 30px;
}

/* Form Styles */
.seo-ranking-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--seo-text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.required {
    color: var(--seo-error);
}

.helper-text {
    font-weight: 400;
    color: var(--seo-text-secondary);
    font-size: 13px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--seo-border-color);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--seo-primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

.keyphrase-count {
    font-size: 13px;
    color: var(--seo-text-secondary);
    margin-top: 6px;
    text-align: right;
}

/* Submit Button */
.btn-submit {
    width: 100%;
    padding: 14px 24px;
    background: var(--seo-primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-submit:hover {
    background: var(--seo-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.3);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit:disabled {
    background: var(--seo-text-secondary);
    cursor: not-allowed;
    transform: none;
}

.btn-text, .btn-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Form Message */
.form-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 16px;
    animation: slideDown 0.3s ease;
}

.form-message.success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #10B981;
}

.form-message.error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #EF4444;
}

/* Dashboard */
.seo-ranking-dashboard {
    animation: fadeIn 0.6s ease-in-out;
}

img.dashboard-logo {
    max-width: 200px !important;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--seo-border-color);
}

.dashboard-logo {
    max-width: 150px;
    height: auto;
}

.dashboard-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--seo-text-primary);
    margin: 0;
}

.btn-new-analysis {
    padding: 10px 20px;
    background: var(--seo-primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-new-analysis:hover {
    background: var(--seo-primary-dark);
}

/* Tabs */
.dashboard-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--seo-border-color);
    overflow-x: auto;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--seo-text-secondary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    color: #ffffff;
}

.tab-btn.active {
    color: #ffffff;
    border-bottom-color: var(--seo-primary-color);
}

[type=button]:focus, [type=button]:hover, [type=submit]:focus, [type=submit]:hover, button:focus, button:hover {
    background-color: var(--seo-primary-color);
}

.tab-btn svg {
    width: 20px;
    height: 20px;
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}

.tab-content.active {
    display: block;
}

.info-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.animate-in {
    animation: slideUp 0.5s ease-in-out;
}

/* Business Info */
.business-info-container {
    display: flex;
    gap: 24px;
    align-items: start;
}

.business-logo {
    flex-shrink: 0;
}

.business-logo img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid var(--seo-border-color);
}

.business-details {
    flex: 1;
}

.business-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--seo-text-primary);
    margin-bottom: 8px;
}

.business-url {
    color: var(--seo-primary-color);
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 12px;
    display: inline-block;
}

.business-url:hover {
    text-decoration: underline;
}

.business-description {
    color: var(--seo-text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}

.business-category {
    display: inline-block;
    padding: 6px 12px;
    background: var(--seo-bg-light);
    border-radius: 6px;
    font-size: 13px;
    color: var(--seo-text-secondary);
    font-weight: 600;
}

.no-data-message {
    text-align: center;
    padding: 40px;
    color: var(--seo-text-secondary);
}

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

.structure-stat {
    text-align: center;
    padding: 20px;
    background: var(--seo-bg-light);
    border-radius: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--seo-primary-color);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: var(--seo-text-secondary);
    font-weight: 600;
}

.main-pages-list {
    margin-top: 20px;
}

.main-pages-list h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--seo-text-primary);
    margin-bottom: 16px;
}

.page-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: var(--seo-bg-light);
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.page-item:hover {
    background: var(--seo-border-color);
}

.page-item a {
    color: var(--seo-text-primary);
    text-decoration: none;
    font-weight: 500;
}

.page-item a:hover {
    color: var(--seo-primary-color);
}

/* Search Results */
.keyphrase-result {
    background: white;
    border: 2px solid var(--seo-border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    animation: slideUp 0.5s ease-in-out;
}

.keyphrase-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--seo-border-color);
}

.keyphrase-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--seo-text-primary);
}

.rank-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 16px;
}

.rank-badge.found {
    background: #D1FAE5;
    color: #065F46;
}

.rank-badge.not-found {
    background: #FEE2E2;
    color: #991B1B;
}

.competitors-section {
    margin-bottom: 24px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--seo-text-primary);
    margin-bottom: 12px;
}

.competitor-item {
    display: flex;
    align-items: start;
    padding: 12px;
    background: var(--seo-bg-light);
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.competitor-item:hover {
    background: var(--seo-border-color);
}

.competitor-position {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--seo-primary-color);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 14px;
    margin-right: 12px;
}

.competitor-details {
    flex: 1;
}

.competitor-title {
    font-weight: 600;
    color: var(--seo-text-primary);
    margin-bottom: 4px;
}

.competitor-url {
    color: var(--seo-text-secondary);
    font-size: 13px;
    text-decoration: none;
    display: block;
    margin-bottom: 6px;
    word-break: break-all;
}

.competitor-snippet {
    color: var(--seo-text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

/* Related Searches */
.related-searches-section {
    margin-top: 24px;
}

.related-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.related-tag {
    padding: 8px 16px;
    background: var(--seo-bg-light);
    border: 1px solid var(--seo-border-color);
    border-radius: 20px;
    font-size: 14px;
    color: var(--seo-text-secondary);
    transition: all 0.3s ease;
    cursor: default;
}

.related-tag:hover {
    background: var(--seo-primary-light);
    color: white;
    border-color: var(--seo-primary-light);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

/* Responsive */
@media (max-width: 768px) {
    .seo-ranking-form-card {
        padding: 24px;
    }
    
    .business-info-container {
        flex-direction: column;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .structure-grid {
        grid-template-columns: 1fr;
    }
    
    .keyphrase-header {
        flex-direction: column;
        gap: 12px;
        align-items: start;
    }
}