/* ---------------------------------------------
   SEO Check Tool - CSS Styles
--------------------------------------------- */
:root {
    --clr1: #1a1a2e;
    --clr2: #16213e;
    --clr3: #0f3460;
    --clr4: #e94560;
    --success: #4ade80;
    --warning: #fbbf24;
    --error: #f87171;
    --info: #60a5fa;
    --btn-bg: rgba(255, 255, 255, 0.9);
    --btn-shadow: rgba(0, 0, 0, 0.15);
    --input-bg: rgba(255, 255, 255, 0.95);
    --card-bg: rgba(255, 255, 255, 0.95);
    --radius: 12px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Animated Gradient Background */
body {
    margin: 0;
    padding: 0;
    font-family: var(--font);
    min-height: 100vh;
    background: linear-gradient(135deg, var(--clr1), var(--clr2), var(--clr3));
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: #333;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Header */
.header {
    text-align: center;
    padding: 2rem 1rem 1rem;
    color: white;
}

.header h1 {
    font-size: 2.2rem;
    margin: 0;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
}

.header h2 {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 400;
    margin: 0.5rem 0 0;
}

/* Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem 1.5rem 3rem;
}

/* Input Section */
.input-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    margin-bottom: 1.5rem;
}

.url-input-wrapper {
    display: flex;
    gap: 0.75rem;
}

.url-input-wrapper input {
    flex: 1;
    padding: 0.9rem 1.2rem;
    border: 2px solid #e5e7eb;
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.url-input-wrapper input:focus {
    outline: none;
    border-color: var(--clr4);
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.15);
}

.url-input-wrapper button {
    padding: 0.9rem 1.5rem;
    background: linear-gradient(135deg, var(--clr4), #ff6b6b);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.url-input-wrapper button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233, 69, 96, 0.35);
}

.hint {
    margin: 0.75rem 0 0;
    font-size: 0.85rem;
    color: #6b7280;
}

/* Loader */
.loader {
    text-align: center;
    padding: 3rem;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--clr4);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

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

/* Results */
.results {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Score Overview */
.score-overview {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.score-circle {
    position: relative;
    width: 140px;
    height: 140px;
    flex-shrink: 0;
}

.score-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-bg {
    fill: none;
    stroke: #e5e7eb;
    stroke-width: 8;
}

.score-fg {
    fill: none;
    stroke: var(--success);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 1.5s ease-out, stroke 0.5s;
}

.score-fg.medium {
    stroke: var(--warning);
}

.score-fg.low {
    stroke: var(--error);
}

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

.score-value span:first-child {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a2e;
}

.score-label {
    font-size: 0.9rem;
    color: #6b7280;
}

.score-details h3 {
    margin: 0 0 0.5rem;
    font-size: 1.3rem;
    word-break: break-all;
}

.score-details p {
    margin: 0;
    color: #6b7280;
}

/* Result Cards */
.result-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.result-card h3 {
    margin: 0 0 1rem;
    font-size: 1.1rem;
    color: var(--clr1);
    border-bottom: 2px solid #f3f4f6;
    padding-bottom: 0.75rem;
}

/* SERP Preview */
.serp-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 640px) {
    .serp-preview {
        grid-template-columns: 1fr;
    }
}

.serp-desktop,
.serp-mobile {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    position: relative;
}

.serp-label {
    position: absolute;
    top: -10px;
    left: 12px;
    background: #6b7280;
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
}

.serp-url {
    color: #202124;
    font-size: 0.75rem;
    margin-bottom: 4px;
}

.serp-title {
    color: #1a0dab;
    font-size: 1.1rem;
    font-weight: 400;
    margin-bottom: 4px;
    text-decoration: underline;
    cursor: pointer;
}

.serp-title.too-long {
    color: var(--error);
}

.serp-title.good {
    color: #1a0dab;
}

.serp-description {
    color: #4d5156;
    font-size: 0.85rem;
    line-height: 1.4;
}

.serp-description.too-long {
    color: var(--warning);
}

.serp-mobile .serp-title {
    font-size: 0.95rem;
}

.serp-mobile .serp-description {
    font-size: 0.8rem;
}

/* Check List */
.check-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.check-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 4px solid #e5e7eb;
}

.check-item.success {
    border-left-color: var(--success);
    background: #f0fdf4;
}

.check-item.warning {
    border-left-color: var(--warning);
    background: #fffbeb;
}

.check-item.error {
    border-left-color: var(--error);
    background: #fef2f2;
}

.check-item.info {
    border-left-color: var(--info);
    background: #eff6ff;
}

.check-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.check-content {
    flex: 1;
}

.check-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.check-detail {
    font-size: 0.85rem;
    color: #6b7280;
    word-break: break-word;
}

/* Headings */
.headings-overview {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.heading-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f3f4f6;
    border-radius: 20px;
    font-size: 0.9rem;
}

.heading-badge .count {
    background: var(--clr3);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.heading-tree {
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 0.85rem;
    background: #1a1a2e;
    color: #e5e7eb;
    padding: 1rem;
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.heading-item {
    padding: 4px 0;
}

.heading-item.h1 {
    color: var(--clr4);
    font-weight: 700;
}

.heading-item.h2 {
    margin-left: 1rem;
    color: #60a5fa;
}

.heading-item.h3 {
    margin-left: 2rem;
    color: #34d399;
}

.heading-item.h4 {
    margin-left: 3rem;
    color: #fbbf24;
}

.heading-item.h5 {
    margin-left: 4rem;
    color: #a78bfa;
}

.heading-item.h6 {
    margin-left: 5rem;
    color: #f472b6;
}

/* Recommendations */
.recommendations {
    background: linear-gradient(135deg, #fff7ed, #fef3c7);
}

.recommendations ul {
    margin: 0;
    padding-left: 1.25rem;
}

.recommendations li {
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.recommendations li strong {
    color: var(--clr4);
}

/* Error Message */
.error-message {
    background: #fef2f2;
    border: 2px solid var(--error);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
}

.error-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.error-message p {
    margin: 0 0 1rem;
    color: #991b1b;
}

.error-message button {
    padding: 0.75rem 1.5rem;
    background: var(--clr4);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
}

/* Info Box */
.info-box {
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    margin-top: 1.5rem;
    border-left: 4px solid var(--info);
}

.info-box h4 {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
}

.info-box p {
    margin: 0;
    font-size: 0.85rem;
    color: #4b5563;
}

.info-box a {
    color: var(--clr4);
    font-weight: 600;
}

/* Back Link */
.back-link {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    background: var(--btn-bg);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    text-decoration: none;
    color: #333;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s;
}

.back-link:hover {
    transform: translateY(-2px);
}

/* Contact */
.contact {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
}

.contact a {
    background: var(--btn-bg);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    text-decoration: none;
    color: #333;
    font-weight: 600;
    display: block;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .score-overview {
        flex-direction: column;
        text-align: center;
    }

    .url-input-wrapper {
        flex-direction: column;
    }

    .back-link,
    .contact {
        position: static;
        display: block;
        text-align: center;
        margin: 1rem auto;
        width: fit-content;
    }
}