:root {
    --bg-primary: #f5f7fb;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --primary: #4f46e5;
    --primary-light: #e0e7ff;
    --primary-dark: #3730a3;
    --accent: #06b6d4;
    --border: #e2e8f0;
    --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.02);
    --ad-bg: #f8fafc;
    --ad-border: #cbd5e1;
    
    --success: #10b981;
    --success-light: #ecfdf5;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-lg: 20px;
    --radius-md: 12px;
}

[data-theme="dark"] {
    --bg-primary: #0b0f19;
    --bg-card: #151d30;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --primary: #6366f1;
    --primary-light: #1e293b;
    --primary-dark: #4f46e5;
    --accent: #22d3ee;
    --border: #1e293b;
    --shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
    --ad-bg: #1e293b;
    --ad-border: #334155;
    
    --success-light: rgba(16, 185, 129, 0.1);
    --warning-light: rgba(245, 158, 11, 0.1);
    --danger-light: rgba(239, 68, 68, 0.1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: var(--transition);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

header {
    padding: 1.5rem 2rem;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-toggle {
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--bg-card);
    padding: 0.6rem;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    color: var(--text-primary);
}
.theme-toggle:hover {
    transform: scale(1.05);
    border-color: var(--primary);
}
.theme-toggle svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}
.theme-toggle .sun-icon { display: none; }
[data-theme="dark"] .theme-toggle .moon-icon { display: none; }
[data-theme="dark"] .theme-toggle .sun-icon { display: block; }

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 1.5rem 3rem 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.text-center { text-align: center; }

h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}
.subtitle {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

/* Ad Styles */
.ad-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--ad-bg);
    border: 1px dashed var(--ad-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin: 0.5rem 0;
    position: relative;
    min-height: 100px;
    overflow: hidden;
}
.ad-container::before {
    content: "SPONSORED";
    position: absolute;
    top: 4px;
    right: 8px;
    font-size: 0.65rem;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    font-weight: 700;
}

/* Input Form Panel */
.search-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
}

.search-form-group {
    display: flex;
    gap: 1rem;
    width: 100%;
}

@media (max-width: 640px) {
    .search-form-group {
        flex-direction: column;
    }
}

.url-input-wrapper {
    position: relative;
    flex: 1;
}

.url-input-wrapper svg {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

.url-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1.05rem;
    outline: none;
    transition: var(--transition);
}

.url-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}
[data-theme="dark"] .url-input:focus {
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.btn-analyze {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    padding: 1rem 2rem;
    font-weight: 600;
    font-size: 1.05rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-analyze:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

/* Dashboard Summary Layout */
.results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 1rem;
    align-items: start;
}

@media (min-width: 992px) {
    .results-grid {
        grid-template-columns: 350px 1fr;
    }
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 2rem;
}

/* SEO Circular Progress Score */
.score-circle-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 0;
    position: relative;
}

.score-svg {
    transform: rotate(-90deg);
    width: 180px;
    height: 180px;
}

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

.score-progress-ring {
    fill: none;
    stroke: var(--primary);
    stroke-width: 14;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.8s ease-out;
}

.score-text-val {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score-num {
    font-family: 'Outfit', sans-serif;
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.score-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.score-grade {
    margin-top: 1rem;
    padding: 0.4rem 1.2rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.02em;
}

/* Category Indicators */
.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}
.metric-row:last-child {
    border-bottom: none;
}
.metric-name {
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.metric-icon {
    width: 20px;
    height: 20px;
}

/* Audit Item Lists */
.audit-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.audit-card {
    border-left: 4px solid var(--border);
    padding: 1.25rem;
    background-color: var(--bg-primary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    display: flex;
    gap: 1.25rem;
    transition: var(--transition);
}

.audit-card.pass {
    border-left-color: var(--success);
}
.audit-card.warning {
    border-left-color: var(--warning);
}
.audit-card.fail {
    border-left-color: var(--danger);
}

.audit-status-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}
.pass .audit-status-icon { color: var(--success); }
.warning .audit-status-icon { color: var(--warning); }
.fail .audit-status-icon { color: var(--danger); }

.audit-details {
    flex: 1;
}

.audit-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.audit-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.audit-data-box {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-family: monospace;
    font-size: 0.85rem;
    word-break: break-all;
    white-space: pre-wrap;
    margin-top: 0.5rem;
    color: var(--text-primary);
}

.tag-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    background-color: var(--primary-light);
    color: var(--primary);
    margin-right: 0.5rem;
}

/* Tabs selector */
.tabs-header {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
    overflow-x: auto;
    padding-bottom: 2px;
}

.tab-btn {
    padding: 0.75rem 1.25rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-primary);
}

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

/* Spinner */
.loading-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    gap: 1.5rem;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Lists and details formatting */
.seo-list-items {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.seo-list-items li {
    padding: 0.5rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
}

.info-card-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Footer layout */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.9rem;
}

.footer-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.current-time-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    color: var(--text-primary);
}
[data-theme="light"] .current-time-badge {
    background: rgba(15, 23, 42, 0.05);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

/* Share Panel */
.share-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    margin-bottom: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 12px 24px;
    box-shadow: var(--shadow);
    align-self: center;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}
.share-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.share-buttons {
    display: flex;
    gap: 10px;
}
.share-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: var(--transition);
    text-decoration: none;
}
.share-btn svg {
    width: 18px;
    height: 18px;
}
.share-btn.twitter-x { background: #1da1f2; }
.share-btn.twitter-x:hover { background: #0c85d0; transform: scale(1.1); }
.share-btn.facebook { background: #1877f2; }
.share-btn.facebook:hover { background: #0d5ec4; transform: scale(1.1); }
.share-btn.linkedin { background: #0a66c2; }
.share-btn.linkedin:hover { background: #08519c; transform: scale(1.1); }
.share-btn.whatsapp { background: #25d366; }
.share-btn.whatsapp:hover { background: #1ebd56; transform: scale(1.1); }

/* Information Card Styling */
.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.25rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

@media (max-width: 768px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
}
