/* Progressive SEO Analyzer Styles */

/* Timeline Styles */
.sap-timeline {
    margin: 3rem 0;
    padding: 2rem;
    background: linear-gradient(145deg, rgba(255,255,255,0.98), rgba(248,249,250,0.95));
    border-radius: var(--sap-radius-lg);
    box-shadow: var(--sap-shadow-xl);
}

.sap-timeline-item {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    margin-bottom: 1rem;
    background: white;
    border-radius: var(--sap-radius);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.sap-timeline-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: #e0e0e0;
    transition: all 0.3s ease;
}

.sap-timeline-item.active::before {
    background: var(--sap-gradient);
    animation: pulse 1.5s infinite;
}

.sap-timeline-item.completed::before {
    background: linear-gradient(135deg, #28a745, #20c557);
}

.sap-timeline-item.error::before {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.sap-timeline-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sap-light);
    border-radius: 50%;
    margin-right: 1.5rem;
    position: relative;
    font-size: 1.5rem;
}

.sap-timeline-item.active .sap-timeline-icon {
    background: var(--sap-gradient);
}

.sap-timeline-item.completed .sap-timeline-icon {
    background: linear-gradient(135deg, #28a745, #20c557);
}

.sap-timeline-item.error .sap-timeline-icon {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

.sap-timeline-icon .spinner {
    display: none;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.sap-timeline-item.active .sap-timeline-icon .spinner {
    display: block;
    position: absolute;
}

.sap-timeline-item.active .sap-timeline-icon .icon {
    display: none;
}

.sap-timeline-icon .checkmark {
    display: none;
    color: white;
    font-size: 1.8rem;
}

.sap-timeline-item.completed .sap-timeline-icon .checkmark {
    display: block;
}

.sap-timeline-item.completed .sap-timeline-icon .icon,
.sap-timeline-item.error .sap-timeline-icon .icon {
    display: none;
}

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

.sap-timeline-content h3 {
    margin: 0 0 0.5rem 0;
    color: var(--sap-dark);
    font-size: 1.2rem;
    font-weight: 600;
}

.sap-timeline-content .status-text {
    margin: 0;
    color: var(--sap-gray);
    font-size: 0.9rem;
}

.sap-timeline-item.active .status-text {
    color: var(--sap-primary);
    font-weight: 500;
}

.sap-timeline-item.completed .status-text {
    color: #28a745;
}

.sap-timeline-item.error .status-text {
    color: #dc3545;
}

/* Progressive Results */
.sap-results-progressive {
    margin-top: 2rem;
}

/* Overall Score */
.sap-overall-score {
    text-align: center;
    padding: 3rem;
    background: linear-gradient(145deg, rgba(255,255,255,0.98), rgba(248,249,250,0.95));
    border-radius: var(--sap-radius-lg);
    box-shadow: var(--sap-shadow-xl);
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.sap-overall-score::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--sap-gradient);
}

.sap-score-circle-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 2rem;
}

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

.sap-score-circle-bg {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 12;
}

.sap-score-circle-fill {
    fill: none;
    stroke: url(#scoreGradient);
    stroke-width: 12;
    stroke-linecap: round;
    stroke-dasharray: 565.48;
    stroke-dashoffset: 565.48;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.sap-score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.sap-score-value {
    font-size: 3.5rem;
    font-weight: 700;
    background: var(--sap-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sap-score-percent {
    font-size: 1.5rem;
    color: var(--sap-gray);
}

.sap-score-title {
    margin: 0 0 0.5rem;
    color: var(--sap-dark);
    font-size: 2rem;
}

.sap-score-subtitle {
    margin: 0;
    color: var(--sap-gray);
    font-size: 1.1rem;
}

.sap-score-points {
    font-weight: 600;
    color: var(--sap-primary);
}

/* Section Styles */
.sap-section {
    background: white;
    border-radius: var(--sap-radius-lg);
    box-shadow: var(--sap-shadow-lg);
    margin-bottom: 2rem;
    overflow: hidden;
    animation: slideIn 0.5s ease;
}

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

.sap-section-header {
    display: flex;
    align-items: center;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-bottom: 2px solid var(--sap-light);
}

.sap-section-icon {
    font-size: 2rem;
    margin-right: 1rem;
}

.sap-section-title {
    flex: 1;
    margin: 0;
    color: var(--sap-dark);
    font-size: 1.4rem;
    font-weight: 600;
}

.sap-section-score {
    background: var(--sap-gradient);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
}

.sap-section-score .score-value {
    font-size: 1.2rem;
}

.sap-section-score .score-max {
    opacity: 0.8;
    font-size: 0.9rem;
}

.sap-section-content {
    padding: 2rem;
}

/* Test Items */
.sap-test-items {
    display: grid;
    gap: 1rem;
}

.sap-test-item {
    padding: 1.2rem;
    background: var(--sap-light);
    border-radius: var(--sap-radius);
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
}

.sap-test-item.status-success {
    border-left-color: #28a745;
    background: linear-gradient(135deg, #f0fdf4, #ffffff);
}

.sap-test-item.status-warning {
    border-left-color: #ffc107;
    background: linear-gradient(135deg, #fffbf0, #ffffff);
}

.sap-test-item.status-error {
    border-left-color: #dc3545;
    background: linear-gradient(135deg, #fef2f2, #ffffff);
}

.sap-test-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.8rem;
}

.sap-test-icon {
    font-size: 1.2rem;
    margin-right: 0.8rem;
}

.sap-test-title {
    flex: 1;
    font-weight: 600;
    color: var(--sap-dark);
}

.sap-test-score {
    background: rgba(98, 89, 166, 0.1);
    color: var(--sap-primary);
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
}

.sap-test-message {
    color: var(--sap-gray);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0.8rem;
}

.sap-test-details {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 0.8rem;
    font-size: 0.9rem;
}

.sap-test-recommendation {
    background: linear-gradient(135deg, #e7f3ff, #f0f8ff);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 0.8rem;
    border: 1px solid rgba(0, 123, 255, 0.2);
    font-size: 0.9rem;
    color: #004085;
}

.sap-test-recommendation strong {
    color: #0056b3;
}

/* Speed Metrics */
.sap-speed-metrics {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-radius: var(--sap-radius);
}

.sap-speed-metrics h4 {
    margin: 0 0 1.5rem;
    color: var(--sap-dark);
    font-size: 1.2rem;
}

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

.sap-metric-card {
    background: white;
    padding: 1.2rem;
    border-radius: var(--sap-radius);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.sap-metric-card.rating-good {
    border-color: #28a745;
}

.sap-metric-card.rating-needs-improvement {
    border-color: #ffc107;
}

.sap-metric-card.rating-poor {
    border-color: #dc3545;
}

.sap-metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.sap-metric-name {
    font-weight: 700;
    color: var(--sap-dark);
    font-size: 1.1rem;
}

.sap-metric-rating {
    font-size: 0.8rem;
    font-weight: 600;
}

.rating-good .sap-metric-rating {
    color: #28a745;
}

.rating-needs-improvement .sap-metric-rating {
    color: #ffc107;
}

.rating-poor .sap-metric-rating {
    color: #dc3545;
}

.sap-metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--sap-primary);
    margin: 0.5rem 0;
}

.sap-metric-description {
    font-size: 0.85rem;
    color: var(--sap-gray);
    margin-bottom: 0.5rem;
}

.sap-metric-optimal {
    font-size: 0.8rem;
    color: #28a745;
    font-weight: 600;
    margin: 0.3rem 0;
    padding: 0.2rem 0.5rem;
    background: rgba(40, 167, 69, 0.1);
    border-radius: 4px;
    display: inline-block;
}

.sap-metric-score {
    font-size: 0.9rem;
    color: var(--sap-gray);
    font-weight: 500;
}

/* Actions */
.sap-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 3rem 0;
    padding: 2rem;
    background: linear-gradient(145deg, rgba(255,255,255,0.98), rgba(248,249,250,0.95));
    border-radius: var(--sap-radius-lg);
}

.sap-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sap-button-primary {
    background: var(--sap-gradient);
    color: white;
}

.sap-button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(98, 89, 166, 0.3);
}

.sap-button-secondary {
    background: white;
    color: var(--sap-primary);
    border: 2px solid var(--sap-primary);
}

.sap-button-secondary:hover {
    background: var(--sap-light);
    transform: translateY(-2px);
}

/* Error State */
.sap-error {
    text-align: center;
    padding: 3rem;
    background: linear-gradient(135deg, #fef2f2, #ffffff);
    border: 2px solid rgba(220, 53, 69, 0.2);
    border-radius: var(--sap-radius-lg);
    margin: 2rem 0;
}

.sap-error-icon {
    font-size: 3rem;
    color: #dc3545;
    margin-bottom: 1rem;
}

.sap-error-message {
    color: #721c24;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.sap-retry-button {
    background: #dc3545;
    color: white;
}

.sap-retry-button:hover {
    background: #c82333;
}

/* Additional styles for tables and lists */
.heading-hierarchy {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
    font-family: monospace;
    font-size: 13px;
    /* Dynamic height - no restrictions */
    /* If you want scrolling, uncomment the lines below */
    /* max-height: 600px; */
    /* overflow-y: auto; */
}

/* For PDF export - no restrictions */
#sap-pdf-export .heading-hierarchy {
    max-height: none !important;
    overflow: visible !important;
    height: auto !important;
}

.heading-item {
    padding: 3px 0;
    line-height: 1.5;
}

.heading-item strong {
    color: #6259a6;
    font-weight: 600;
}

.files-breakdown {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
}

.files-breakdown h5 {
    margin: 15px 0 10px 0;
    color: #333;
    font-size: 14px;
    font-weight: 600;
}

.files-breakdown h5:first-child {
    margin-top: 0;
}

.file-list {
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
}

.file-list li {
    padding: 4px 0;
    font-size: 12px;
}

.file-list code {
    background: white;
    padding: 2px 6px;
    border-radius: 3px;
    color: #e83e8c;
    font-size: 11px;
}

.keywords-analysis {
    margin-top: 10px;
}

.keywords-analysis h5 {
    margin: 20px 0 10px 0;
    color: #333;
    font-size: 14px;
    font-weight: 600;
}

.keywords-table,
.phrases-table {
    margin-bottom: 20px;
    font-size: 13px;
}

.keywords-table th,
.phrases-table th {
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    font-weight: 600;
    color: #495057;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.keywords-table td,
.phrases-table td {
    background: white;
}

.keywords-table tr:hover td,
.phrases-table tr:hover td {
    background: #f8f9fa;
}

/* Responsive */
@media (max-width: 768px) {
    .sap-timeline-item {
        padding: 1rem;
    }

    .sap-timeline-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        margin-right: 1rem;
    }

    .sap-timeline-content h3 {
        font-size: 1rem;
    }

    .sap-score-value {
        font-size: 2.5rem;
    }

    .sap-metrics-grid {
        grid-template-columns: 1fr;
    }

    .sap-section-header {
        padding: 1rem 1.5rem;
    }

    .sap-section-content {
        padding: 1.5rem;
    }

    .sap-actions {
        flex-direction: column;
        padding: 1.5rem;
    }

    .sap-button {
        width: 100%;
        justify-content: center;
    }
}