/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #7c3aed;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-bg: #0f172a;
    --card-bg: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo i {
    font-size: 32px;
    color: var(--primary-color);
}

.logo h1 {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.badge {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

/* Search Section */
.search-section {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.search-container h2 {
    text-align: center;
    margin-bottom: 25px;
    font-size: 24px;
}

.search-box {
    display: flex;
    gap: 15px;
    max-width: 800px;
    margin: 0 auto;
}

.search-box input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid var(--border-color);
    background: var(--dark-bg);
    color: var(--text-primary);
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-analyze {
    padding: 15px 30px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-analyze:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);
}

/* Loading Animation */
.loading {
    text-align: center;
    padding: 30px;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Section Title */
.section-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

/* Metrics Grid */
.overview-section {
    margin-bottom: 30px;
}

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

.metric-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.metric-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.metric-icon.blue { background: rgba(37, 99, 235, 0.2); color: var(--primary-color); }
.metric-icon.green { background: rgba(16, 185, 129, 0.2); color: var(--success-color); }
.metric-icon.purple { background: rgba(124, 58, 237, 0.2); color: var(--secondary-color); }
.metric-icon.orange { background: rgba(245, 158, 11, 0.2); color: var(--warning-color); }

.metric-info h4 {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 8px;
}

.metric-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.metric-change {
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
}

.metric-change.positive {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
}

.metric-change.negative {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger-color);
}

/* Chart Section */
.chart-section {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 16px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.chart-container {
    position: relative;
    height: 350px;
}

.chart-container-small {
    position: relative;
    height: 250px;
    margin-top: 20px;
}

/* Two Column Layout */
.two-column-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

/* Data Sections */
.data-section {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 16px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.data-section.full-width {
    grid-column: 1 / -1;
}

/* Tables */
.table-container {
    overflow-x: auto;
    margin-top: 15px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--dark-bg);
}

.data-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.data-table tbody tr {
    transition: all 0.2s;
}

.data-table tbody tr:hover {
    background: rgba(37, 99, 235, 0.05);
}

/* Backlinks Stats */
.backlinks-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.stat-item {
    background: var(--dark-bg);
    padding: 15px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

/* SEO Score Circle */
.seo-score-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.score-circle {
    position: relative;
    margin-bottom: 30px;
}

.score-circle svg {
    transform: rotate(-90deg);
}

.score-bg {
    fill: none;
    stroke: var(--border-color);
    stroke-width: 10;
}

.score-fill {
    fill: none;
    stroke: var(--success-color);
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 377;
    stroke-dashoffset: 377;
    transition: stroke-dashoffset 2s ease;
}

.score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    font-weight: 700;
}

.score-details {
    width: 100%;
}

.score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    margin-bottom: 10px;
    background: var(--dark-bg);
    border-radius: 8px;
}

.score-item-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.score-item-value {
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 6px;
}

.score-item-value.pass {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
}

.score-item-value.warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning-color);
}

.score-item-value.fail {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger-color);
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-secondary);
    margin-top: 50px;
    border-top: 1px solid var(--border-color);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .two-column-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .search-box {
        flex-direction: column;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .logo h1 {
        font-size: 20px;
    }
    
    .search-section {
        padding: 25px;
    }
    
    .data-section {
        padding: 20px;
    }
}

/* Keyword Badge */
.keyword-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.keyword-badge.top3 {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
}

.keyword-badge.top10 {
    background: rgba(37, 99, 235, 0.2);
    color: var(--primary-color);
}

.keyword-badge.top20 {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning-color);
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--dark-bg);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
    transition: width 1s ease;
}

/* Link Styles */
.link-url {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

.link-url:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Tooltip */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: var(--dark-bg);
    color: var(--text-primary);
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

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

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

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

