/* ===================================
   PerSeo Insights - Minimal CSS
   Using Tailwind for most styling
   =================================== */

/* CSS Variables - Brand Colors from Logo */
:root {
    --color-primary: #0284c7;
    --color-primary-dark: #0F172A;
    --color-accent: #38bdf8;
}

/* Global default text color for dark theme */
body {
    color: #e2e8f0;
}
strong, b {
    color: inherit;
}

/* ===================================
   GLOBAL DARK FORM ELEMENTS
   =================================== */

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
textarea,
select {
    background-color: rgba(15, 23, 42, 0.8) !important;
    color: #f1f5f9 !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    outline: none !important;
}

#urlInput:focus {
    border-color: var(--color-primary) !important;
    outline: none !important;
}
input::placeholder,
textarea::placeholder {
    color: #64748b !important;
}
select option {
    background-color: #1e293b;
    color: #f1f5f9;
}
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #0F172A inset !important;
    -webkit-text-fill-color: #f1f5f9 !important;
}

/* ===================================
   AUTH PAGES BACKGROUND
   =================================== */

.auth-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0F172A;
}

.auth-overlay {
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
}

/* ===================================
   CUSTOM ANIMATIONS
   =================================== */

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

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

@keyframes magicShine {
    0% { left: -50%; }
    100% { left: 150%; }
}

@keyframes wizardFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-3px) rotate(5deg);
    }
}

@keyframes wizardFloatFast {
    0%, 100% {
        transform: translateY(0) rotate(-15deg);
    }
    50% {
        transform: translateY(-5px) rotate(-10deg);
    }
}

@keyframes sparkle {
    0%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

@keyframes sparkleFast {
    0%, 100% {
        opacity: 0.5;
        transform: scale(0.9) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: scale(1.1) rotate(180deg);
    }
}

@keyframes progressShine {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

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

/* ===================================
   HEADER ANIMATIONS
   =================================== */

.header-logo {
    animation: fadeInDown 0.6s ease-out;
}

.header-logo img {
    max-width: 120px;
    height: auto;
}

.header h1 {
    animation: fadeInDown 0.6s ease-out 0.1s both;
}

.header-tagline {
    animation: fadeInDown 0.6s ease-out 0.2s both;
}

.header-subtitle {
    animation: fadeInDown 0.6s ease-out 0.3s both;
}

/* ===================================
   MAGIC BUTTON & TITLE
   =================================== */

.magic-button {
    background: linear-gradient(135deg, #0284c7 0%, #0F172A 100%);
    box-shadow: 0 4px 15px rgba(155, 167, 206, 0.4), 0 0 20px rgba(169, 222, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.magic-button::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(169, 222, 255, 0.2), transparent);
    transform: rotate(45deg);
    animation: magicShine 3s infinite;
}

.magic-button .wizard-hat {
    animation: wizardFloat 2s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.5));
}

.magic-button .sparkle-1 {
    animation: sparkle 1.5s ease-in-out infinite;
}

.magic-button .sparkle-2 {
    animation: sparkle 1.5s ease-in-out infinite 0.75s;
}

.magic-button:hover {
    background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
    box-shadow: 0 6px 20px rgba(169, 222, 255, 0.5), 0 0 30px rgba(155, 167, 206, 0.3);
    transform: translateY(-3px) scale(1.02);
}

.magic-button:hover .wizard-hat {
    animation: wizardFloatFast 1s ease-in-out infinite;
    transform: rotate(-15deg);
}

.magic-button:hover .sparkle-1,
.magic-button:hover .sparkle-2 {
    animation: sparkleFast 0.8s ease-in-out infinite;
}

/* Magic Title Effect */
.magic-title {
    position: relative;
    display: inline-block;
    background: linear-gradient(135deg, #ffffff 0%, #38bdf8 50%, #ffffff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: magicTitleShine 4s ease-in-out infinite;
    text-shadow: 0 0 30px rgba(169, 222, 255, 0.5);
}

.magic-title::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: radial-gradient(circle, rgba(169, 222, 255, 0.3) 0%, transparent 70%);
    animation: magicGlow 3s ease-in-out infinite;
    z-index: -1;
    border-radius: 20px;
}

@keyframes magicTitleShine {
    0%, 100% {
        background-position: 0% center;
    }
    50% {
        background-position: 200% center;
    }
}

@keyframes magicGlow {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.05);
    }
}

/* ===================================
   PROGRESS BAR
   =================================== */

.progress-bar {
    background: linear-gradient(90deg, #44adf7, #8761f6, #44adf7);
    background-size: 200% 100%;
    animation: progressShine 2s ease-in-out infinite;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(68, 173, 247, 0.5);
}

/* ===================================
   RESULTS SECTIONS
   =================================== */

.error-section,
.warning-section {
    margin-top: 20px;
}

.error-section h4,
.warning-section h4 {
    color: #e5e7eb;
    margin-bottom: 10px;
    font-size: 1.125rem;
    font-weight: 600;
}

/* Page Preview/Screenshot */
.page-preview {
    margin-top: 20px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
}

.page-preview-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.page-preview-image {
    width: 100%;
    max-width: 800px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
    display: block;
    margin: 0 auto;
    transition: transform 0.3s ease;
}

.page-preview-image:hover {
    transform: scale(1.02);
}

.page-preview-thumbnail {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 5px;
    display: block;
    margin: 0 auto;
}

.page-preview-loading {
    text-align: center;
    padding: 30px;
    color: #9ca3af;
}

.page-preview-error {
    text-align: center;
    padding: 15px;
    color: #c33;
    background: #fee;
    border-radius: 5px;
    border: 1px solid #f44;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.preview-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.preview-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-primary-dark);
    margin-bottom: 10px;
}

.preview-description {
    color: #9ca3af;
    font-size: 0.875rem;
    margin-bottom: 20px;
    font-style: italic;
    text-align: center;
    padding: 10px;
    background: #e8f4fd;
    border-radius: 5px;
    border: 1px solid rgba(255,255,255,0.08);
}

.preview-item .page-preview-thumbnail {
    max-width: 100%;
    width: auto;
    max-height: 300px;
}

@media (max-width: 768px) {
    .page-preview-image,
    .page-preview-thumbnail {
        max-height: 300px;
    }

    .preview-grid {
        grid-template-columns: 1fr;
    }
}

#summary h3,
#pageResults h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary-dark);
    margin-bottom: 1.5rem;
}

/* Page Result */
.page-result {
    margin-bottom: 30px;
    padding: 20px;
    background: #0F172A;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.page-url {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-primary-dark);
    margin-bottom: 20px;
    padding: 15px 20px;
    background: #0F172A;
    border-radius: 10px;
    border: 2px solid var(--color-primary);
    word-break: break-all;
    box-shadow: 0 2px 8px rgba(155, 167, 206, 0.1);
}

.agent-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--color-primary-dark);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--color-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ===================================
   SEO SCORE
   =================================== */

.seo-score-container {
    display: flex;
    align-items: center;
    gap: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.seo-score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 8px solid;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #0F172A;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.15);
    flex-shrink: 0;
    animation: scoreCircleAppear 0.6s ease-out backwards;
    transform-origin: center;
}

@keyframes scoreCircleAppear {
    from {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    to {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.seo-score-value {
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
    animation: scoreValueCount 1s ease 0.3s backwards;
}

@keyframes scoreValueCount {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.seo-score-label {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.seo-score-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.seo-score-grade {
    display: inline-block;
    padding: 8px 16px;
    color: white;
    font-weight: 700;
    border-radius: 10px;
    font-size: 1.125rem;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.seo-score-text {
    font-size: 1.125rem;
    color: #e5e7eb;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .seo-score-container {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .seo-score-circle {
        width: 100px;
        height: 100px;
        border-width: 6px;
    }

    .seo-score-value {
        font-size: 28px;
    }
}

/* ===================================
   INFO ITEMS
   =================================== */

.info-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);  /* Mobile: 1 column */
    gap: 16px;
    margin-bottom: 16px;
}

/* Tablet: 2 columns */
@media (min-width: 768px) {
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop: 3 columns */
@media (min-width: 1024px) {
    .info-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Override for specific grids that need 4 columns on desktop */
.info-grid.grid-cols-4 {
    grid-template-columns: repeat(1, 1fr);
}

@media (min-width: 768px) {
    .info-grid.grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .info-grid.grid-cols-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

.info-item {
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
    padding: 16px;  /* Uniform padding */
    border-radius: 8px;
    background: #111827;
    border: 1px solid rgba(255,255,255,0.08);
    min-height: 100px;  /* Ensure uniform height */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.info-label {
    font-size: 0.875rem;
    font-weight: 400;
    color: #6b7280; /* Tailwind gray-500 */
    margin-bottom: 5px;
}

.info-value {
    font-weight: 400;
    color: #e2e8f0;
    font-size: 1rem;
    word-break: break-word;
    overflow-wrap: break-word;
    overflow: hidden;
    max-width: 100%;
}

.info-item.clickable {
    cursor: pointer;
}

/* Info icon wrapper for hover detection */
.info-icon {
    position: relative;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    z-index: 10;
}

/* When info-icon is inside info-item, position it absolutely */
.info-item > .info-icon {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 100;
}

/* When hovering icon, elevate the entire parent info-item */
.info-item:has(> .info-icon:hover) {
    z-index: 9999997;
}

/* Auto-show info icon for info-items with title attribute */
.info-item[title]::after {
    content: '\f05a';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 14px;
    position: absolute;
    top: 12px;
    right: 12px;
    opacity: 0.4;
    color: #6366f1;
    cursor: help;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.info-item[title]:hover::after {
    opacity: 0.8;
}

/* Tooltip for info-items with title - styled like homepage */
/* Positioned near the icon on the right */
.info-item[title]::before {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 8px);
    right: -10px;
    background: #0F172A;
    color: white;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    line-height: 1.5;
    white-space: normal;
    max-width: min(280px, calc(100vw - 40px));
    min-width: 150px;
    width: max-content;
    text-align: left;
    z-index: 999999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease 0.2s, transform 0.3s ease 0.2s;
    box-shadow: 0 6px 16px rgba(11, 0, 43, 0.4);
    word-wrap: break-word;
    overflow-wrap: break-word;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Only show tooltip when hovering the icon area (right 50px of the item) */
.info-item[title]:hover::before {
    opacity: 1;
    transform: translateY(-4px);
    transition-delay: 0.3s;
}

/* Don't show tooltip immediately - requires hovering near icon */
.info-item[title]::before {
    pointer-events: none;
}

/* FontAwesome icon for info */
.info-icon::before {
    content: '\f05a';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 14px;
    opacity: 0.6;
    transition: opacity 0.3s ease;
    color: var(--color-primary);
    position: relative;
    z-index: 1;
}

.info-icon:hover::before {
    opacity: 1;
}

/* Tooltip styling - smart positioning to avoid screen edges */
.info-icon[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    background: var(--color-primary-dark);
    color: white;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    line-height: 1.5;
    text-transform: none !important;
    font-weight: 400 !important;
    letter-spacing: 0 !important;
    white-space: normal;
    max-width: min(300px, calc(100vw - 40px));
    min-width: 100px;
    width: max-content;
    text-align: left;
    z-index: 9999999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 6px 16px rgba(11, 0, 43, 0.4);
    word-wrap: break-word;
    overflow-wrap: break-word;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    /* Position below the icon */
    bottom: auto;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
}

.info-icon[data-tooltip]:hover::after {
    opacity: 1;
}

/* Smart tooltip positioning classes */
.info-icon.tooltip-left[data-tooltip]::after {
    left: 0;
    transform: translateX(0);
}

.info-icon.tooltip-right[data-tooltip]::after {
    left: auto;
    right: 0;
    transform: translateX(0);
}

.info-icon.tooltip-center[data-tooltip]::after {
    left: 50%;
    transform: translateX(-50%);
}

@media (max-width: 768px) {
    .info-icon[data-tooltip]::after {
        max-width: calc(100vw - 20px);
        font-size: 0.75rem;
    }
}

/* JS tooltip (position:fixed on body) handles all tooltip display.
   Suppress the CSS pseudo-element tooltip which is clipped by overflow containers. */
.info-icon[data-tooltip]::after,
.info-icon[data-tooltip]:hover::after {
    content: none !important;
    display: none !important;
    opacity: 0 !important;
}

.info-item.clickable:hover {
    box-shadow: 0 4px 12px rgba(155, 167, 206, 0.2);
}

/* Color coding for info-items based on status */
.info-item.good {
    background: linear-gradient(135deg, rgba(16,185,129,0.12) 0%, rgba(16,185,129,0.06) 100%);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16,185,129,0.35);
}

.info-item.warning {
    background: linear-gradient(135deg, rgba(245,158,11,0.12) 0%, rgba(245,158,11,0.06) 100%);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245,158,11,0.35);
}

.info-item.error {
    background: linear-gradient(135deg, rgba(239,68,68,0.12) 0%, rgba(239,68,68,0.06) 100%);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239,68,68,0.35);
}

/* State color cascades into info-value text for visual consistency.
   Sub-elements with explicit Tailwind color classes (text-green-400 etc.) override this via their own rule. */
.info-item.good .info-value    { color: #10b981; }
.info-item.warning .info-value { color: #fbbf24; }
.info-item.error .info-value   { color: #ef4444; }

.info-item.poor {
    background: linear-gradient(135deg, rgba(220,38,38,0.12) 0%, rgba(220,38,38,0.06) 100%);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.15);
    border: 1px solid rgba(220,38,38,0.35);
}

.info-item.neutral {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
}

/* Detail Cards - Now placed after info-grid, no more wrappers */
.detail-card {
    grid-column: 1 / -1;
    background: #0F172A;
    border-radius: 8px;
    border: 2px solid transparent;
    box-shadow: none;
    overflow: hidden;
    margin-top: 0;
    margin-bottom: 0;
    padding: 0;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.4s ease, margin 0.4s ease;
}

.detail-card.active {
    max-height: 500px;
    opacity: 1;
    padding: 20px;
    margin-top: 16px;
    margin-bottom: 8px;
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
}

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

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

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

.detail-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.detail-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #f1f5f9;
}

.detail-card-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.detail-card-close:hover {
    color: #ef4444;
}

.detail-card-body {
    max-height: 400px;
    overflow-y: auto;
}

.detail-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.detail-list-item {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background: #1e293b;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    color: #94a3b8;
    border: 1px solid rgba(255,255,255,0.08);
}

.detail-list-item strong {
    margin-right: 0.5rem;
}

/* Error, Warning, Success Items */
.error-item {
    padding: 8px 12px;
    background: rgba(239,68,68,0.1);
    margin-bottom: 5px;
    border-radius: 3px;
    color: #fca5a5;
    font-size: 1rem;
    border-left: 3px solid #ef4444;
}

.warning-item {
    padding: 8px 12px;
    background: rgba(245,158,11,0.1);
    margin-bottom: 5px;
    border-radius: 3px;
    color: #fcd34d;
    font-size: 1rem;
    border-left: 3px solid #f59e0b;
}

.success-item {
    padding: 8px 12px;
    background: rgba(16,185,129,0.1);
    margin-bottom: 5px;
    border-radius: 3px;
    color: #6ee7b7;
    font-size: 1rem;
    border-left: 3px solid #10b981;
}

/* ===================================
   BACK TO TOP BUTTON
   =================================== */

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    background: rgba(2,132,199,.20);
    color: #38bdf8;
    border: 1px solid rgba(2,132,199,.40);
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
    z-index: 1000;
    line-height: 1;
    padding: 0;
}

.back-to-top.show {
    display: flex;
}

.back-to-top:hover {
    background: rgba(2,132,199,.30);
    border-color: rgba(56,189,248,.55);
    color: #7dd3fc;
    transform: translateY(-2px);
    box-shadow: none;
}

/* ===================================
   SPINNER
   =================================== */

.spinner {
    border: 3px solid rgba(155, 167, 206, 0.1);
    border-top: 3px solid #0284c7;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

/* ===================================
   CORE WEB VITALS
   =================================== */

.cwv-container {
    background: #111827;
    padding: 20px;
    border-radius: 10px;
    margin-top: 10px;
}

.cwv-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.cwv-header h4 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #f1f5f9;
}

.cwv-tabs {
    display: flex;
    gap: 5px;
    background: rgba(255,255,255,0.06);
    padding: 4px;
    border-radius: 5px;
}

.cwv-tab {
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: #9ca3af;
    transition: all 0.25s ease-in-out;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cwv-tab:hover {
    background: rgba(2,132,199,.10);
    color: #7dd3fc;
}

.cwv-tab.active {
    background: rgba(2,132,199,.20);
    color: #38bdf8;
    border: 1px solid rgba(2,132,199,.40);
    box-shadow: none;
}

.cwv-tab i {
    font-size: 14px;
}

.cwv-load-btn {
    background: rgba(2,132,199,.20);
    color: #38bdf8;
    border: 1px solid rgba(2,132,199,.40);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    margin: 15px auto;
    box-shadow: none;
}

.cwv-load-btn:hover {
    background: rgba(2,132,199,.30);
    border-color: rgba(56,189,248,.55);
    color: #7dd3fc;
    transform: none;
    box-shadow: none;
}

.cwv-load-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.cwv-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    color: #9ca3af;
}

.cwv-loading p {
    margin: 0;
    font-size: 0.875rem;
}

.cwv-result {
    margin-top: 15px;
}

.cwv-score {
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    border: 3px solid;
}

.cwv-score.good {
    background: rgba(16,185,129,0.12);
    border-color: #10b981;
}

.cwv-score.warning {
    background: rgba(245,158,11,0.12);
    border-color: #f59e0b;
}

.cwv-score.poor {
    background: rgba(239,68,68,0.12);
    border-color: #ef4444;
}

.cwv-score-value {
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
}

.cwv-score-label {
    position: relative;
    font-size: 1.125rem;
    color: #9ca3af;
    margin-top: 5px;
    padding-right: 25px;  /* Space for icon */
}

.cwv-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.cwv-metric {
    padding: 15px;
    border-radius: 5px;
    text-align: center;
}

.cwv-metric.good {
    background: rgba(16,185,129,0.12);
}

.cwv-metric.warning {
    background: rgba(245,158,11,0.12);
}

.cwv-metric.poor {
    background: rgba(239,68,68,0.12);
}

.cwv-metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #e5e7eb;
}

.cwv-metric-label {
    position: relative;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-top: 5px;
    padding-right: 25px;  /* Space for icon */
}

.cwv-metric-desc {
    font-size: 0.875rem;
    color: #9ca3af;
    margin-top: 5px;
}

.cwv-strategy {
    text-align: center;
    padding: 10px;
    background: #0F172A;
    border-radius: 5px;
    margin-bottom: 15px;
    font-size: 0.875rem;
    color: #9ca3af;
}

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

/* ===================================
   SITEMAP DATATABLE STYLES
   =================================== */

.sitemap-report {
    background: #0F172A;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: fadeInUp 0.5s ease-out;
}

.report-header {
    margin-bottom: 30px;
    text-align: center;
}

.report-header h2 {
    color: var(--color-primary);
    font-size: 2rem;
    margin-bottom: 10px;
}

.report-subtitle {
    color: #9ca3af;
    font-size: 1.125rem;
}

.datatable-container {
    width: 100%;
}

.datatable-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
    flex-wrap: wrap;
}

.table-search {
    flex: 1;
    max-width: 400px;
    min-width: 200px;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.table-search:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(155, 167, 206, 0.1);
}

.table-info {
    color: #9ca3af;
    font-size: 0.875rem;
    font-weight: 500;
}

.table-info span {
    font-weight: 700;
    color: var(--color-primary);
    font-size: 1.125rem;
}

.table-responsive {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e0e0e0;
}

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

.sitemap-table td {
    vertical-align: middle;
}

/* Expand Cell & Icon */
.expand-cell {
    width: 30px;
    text-align: center;
    padding: 14px 8px !important;
}

.expand-icon {
    display: inline-block;
    font-size: 12px;
    color: var(--color-primary);
    transition: transform 0.3s ease;
    cursor: pointer;
}

.sitemap-row.expanded .expand-icon {
    transform: rotate(90deg);
}

/* Detail Row */
.sitemap-detail-row {
    background: #1e293b;
    transition: all 0.3s ease;
}

.detail-content {
    padding: 0 !important;
}

.detail-inner {
    padding: 20px 40px;
}

.detail-section {
    margin-bottom: 15px;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section h5 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
}

.issue-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.issue-list li {
    padding: 8px 12px;
    margin: 4px 0;
    background: #0F172A;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 4px;
    font-size: 13px;
}

/* URL Cell */
.url-cell {
    max-width: 400px;
}

.url-cell a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.url-cell a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

/* Metric Cells */
.metric-cell {
    font-weight: 600;
    text-align: center;
}

.metric-cell.fast {
    color: #10b981;
}

.metric-cell.medium {
    color: #f59e0b;
}

.metric-cell.slow {
    color: #ef4444;
}

.metric-cell.small {
    color: #10b981;
}

.metric-cell.large {
    color: #ef4444;
}

/* Score Badge */
.score-cell {
    text-align: center;
}

.score-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    color: white;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.score-value {
    font-size: 18px;
}

.score-grade {
    font-size: 14px;
    opacity: 0.9;
}

/* Count Cells */
.count-cell {
    text-align: center;
    font-weight: 600;
    color: #9ca3af;
}

.count-cell.has-warnings {
    color: #f59e0b;
    font-weight: 700;
}

.count-cell.has-errors {
    color: #ef4444;
    font-weight: 700;
}

/* Responsive Table */
@media (max-width: 768px) {
    .datatable-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .table-search {
        max-width: 100%;
    }

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


    .score-badge {
        padding: 6px 12px;
    }

    .score-value {
        font-size: 16px;
    }
}

/* ===================================
   DATATABLE OVERRIDES
   =================================== */

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--color-primary) !important;
    border-color: var(--color-primary) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--color-primary-dark) !important;
    border-color: var(--color-primary-dark) !important;
}

/* ===================================
   SEO CATEGORIES
   =================================== */

/* Key Metrics Grid */
.key-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 20px 0 30px 0;
}

.seo-categories-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
}

.seo-category {
    background: #0F172A;
    border-radius: 12px;
    overflow: visible;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}


.seo-category-header {
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
    padding: 16px 20px;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
    border-radius: 12px 12px 0 0;
}

.seo-category-header.collapsed {
    border-radius: 12px;
}


.seo-category-title {
    color: white;
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.category-issues {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    margin-right: 8px;
    font-size: 12px;
    font-weight: 600;
}

.issue-count {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.error-count {
    background: rgba(239, 68, 68, 0.9);
}

.warning-count {
    background: rgba(245, 158, 11, 0.9);
}

.seo-category-toggle {
    transition: transform 0.3s ease;
    font-size: 12px;
    flex-shrink: 0;
}

.seo-category-header.collapsed .seo-category-toggle {
    transform: rotate(-90deg);
}

.seo-category-body {
    padding: 20px;
    background: #0F172A;
    transition: all 0.3s ease;
}

.seo-category-body.collapsed {
    display: none !important;
}

/* ===================================
   COPY TO CLIPBOARD BUTTONS
   =================================== */

.copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    margin-left: 8px;
    background: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.copy-btn:hover {
    background: var(--color-primary);
    color: white;
    transform: scale(1.1);
}

.copy-btn:active {
    transform: scale(0.9);
}

.copy-btn.copied {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

/* ===================================
   LANGUAGE SELECTOR
   =================================== */

.lang-selector-dropdown {
    position: relative;
    z-index: 1000;
}

.lang-selector-current {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 2.5rem;
    line-height: 1.25rem;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    font-family: inherit;
}

.lang-selector-current:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.lang-selector-current svg {
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.lang-selector-current i {
    font-size: 0.625rem;
    opacity: 0.7;
    transition: transform 0.3s ease;
}

/* Language Dropdown Menu */
.lang-selector-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 160px;
    padding-top: 0.5rem;
    background: transparent;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 0.2s ease;
    z-index: 1001;
}

.lang-selector-menu-inner {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(155, 167, 206, 0.2);
    border-radius: 0.75rem;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.lang-selector-dropdown:hover .lang-selector-menu,
.lang-selector-dropdown.open .lang-selector-menu,
.lang-selector-dropdown:focus-within .lang-selector-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-selector-dropdown:hover .lang-selector-current i,
.lang-selector-dropdown.open .lang-selector-current i,
.lang-selector-dropdown:focus-within .lang-selector-current i {
    transform: rotate(180deg);
}

.lang-selector-menu-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 0.875rem;
    color: #374151;
    text-decoration: none;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.lang-selector-menu-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(135deg, #0284c7, #0F172A);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.lang-selector-menu-item:hover {
    background: rgba(155, 167, 206, 0.08);
    color: #0F172A;
}

.lang-selector-menu-item:hover::before {
    transform: scaleX(1);
}

.lang-selector-menu-item svg {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 0.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.lang-selector-menu-item span {
    font-size: 0.75rem;
    font-weight: 600;
    flex: 1;
}

.lang-selector-menu-item.active {
    background: linear-gradient(135deg, rgba(155, 167, 206, 0.12), rgba(11, 0, 43, 0.08));
    color: #0F172A;
    font-weight: 700;
}

.lang-selector-menu-item.active::before {
    transform: scaleX(1);
}

/* ===================================
   TAB NAVIGATION SYSTEM
   =================================== */

.tab-button {
    position: relative;
    cursor: pointer;
    white-space: nowrap;
    outline: none;
}

.tab-button:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

.tab-button.active {
    color: #44adf7;
    border-bottom-color: #44adf7 !important;
}

.tab-button:not(.active):hover {
    color: #7dd3fc;
    border-bottom-color: rgba(56,189,248,.50);
    background: rgba(2,132,199,.08);
}

/* Issue badges on tab buttons */
.tab-issue-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    margin-left: 6px;
    vertical-align: middle;
    flex-shrink: 0;
}

.tab-issue-badge.error-badge {
    background: rgba(239, 68, 68, 0.85);
    color: #fff;
}

.tab-issue-badge.warning-badge {
    background: rgba(245, 158, 11, 0.85);
    color: #0F172A;
}

.tab-panel {
    animation: fadeIn 0.3s ease-in-out;
}

.tab-panel.hidden {
    display: none;
}

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

/* Mobile responsive tabs */
@media (max-width: 640px) {
    #tabNavigation {
        flex-direction: column;
    }

    .tab-button {
        width: 100%;
        justify-content: center;
        border-bottom: none;
        padding-left: 12px;
    }

    .tab-button.active {
        border-bottom: none !important;
    }

    /* Stack grids on mobile */

    .key-metrics-grid,
    .info-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* Tablet responsive */

@media (max-width: 1024px) and (min-width: 641px) {
    .key-metrics-grid,
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===================================
   CTA BUTTON (formerly magic-button)
   =================================== */

.cta-button {
    background: linear-gradient(135deg, #44adf7 0%, #8761f6 100%);
    box-shadow: 0 4px 15px rgba(68, 173, 247, 0.35), 0 0 20px rgba(135, 97, 246, 0.2);
    position: relative;
    overflow: hidden;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transform: rotate(45deg);
    animation: magicShine 3s infinite;
}

.cta-button:hover {
    background: linear-gradient(135deg, #5bbcf8 0%, #9875f7 100%);
    box-shadow: 0 6px 20px rgba(68, 173, 247, 0.5), 0 0 30px rgba(135, 97, 246, 0.4);
    transform: translateY(-3px) scale(1.02);
}

.cta-button-static::before {
    display: none !important;
}

/* ===================================
   AUTH PANEL BUTTONS
   =================================== */

.auth-panel {
    display: flex;
    align-items: center;
}

.auth-container {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.auth-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    cursor: pointer;
    position: relative;
    min-height: 2.5rem;
    line-height: 1.25rem;
}

.auth-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.auth-btn:active {
    transform: translateY(0px) scale(0.98);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.2);
}

.auth-btn.primary {
    background: linear-gradient(135deg, #44adf7 0%, #8761f6 100%);
    color: white;
    font-weight: 700;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(68, 173, 247, 0.3);
}

.auth-btn.primary:hover {
    background: linear-gradient(135deg, #5bbcf8 0%, #9875f7 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(68, 173, 247, 0.4);
}

.auth-btn.primary:active {
    transform: translateY(0px) scale(0.98);
    box-shadow: 0 2px 6px rgba(169, 222, 255, 0.3);
}

.auth-btn.logout:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.auth-btn.logout:active {
    transform: translateY(0px) scale(0.98);
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}

/* Username display in auth panel - clickable to profile */
.auth-username {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.5rem;
    border: 1px solid rgba(169, 222, 255, 0.3);
    background: rgba(169, 222, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    cursor: pointer;
    min-height: 2.5rem;
    line-height: 1.25rem;
}

.auth-username:hover {
    background: rgba(169, 222, 255, 0.2);
    border-color: rgba(169, 222, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(169, 222, 255, 0.25);
}

.auth-username:active {
    transform: translateY(0px) scale(0.98);
    box-shadow: 0 2px 6px rgba(169, 222, 255, 0.2);
    background: rgba(169, 222, 255, 0.25);
}

.auth-username i {
    color: rgba(169, 222, 255, 0.9);
}

/* ===================================
   SCAN DETAILS PAGE STYLES
   =================================== */

.section-card {
    background: #0F172A;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    min-height: 280px;
}

.data-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1rem;
}

@media (min-width: 768px) {
    .data-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.data-item {
    background: #f9fafb;
    border-radius: 0.5rem;
    padding: 1rem;
    border: 1px solid rgba(255,255,255,0.1);
}

.data-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #6b7280;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.data-value {
    font-size: 0.875rem;
    color: #111827;
    line-height: 1.5;
    word-wrap: break-word;
}

/* ===================================
   GAUGE CHARTS
   =================================== */

.metric-gauge {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 0 auto;
}

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

.gauge-bg {
    fill: none;
    stroke: #e5e7eb;
    stroke-width: 12;
    stroke-linecap: round;
}

.gauge-fill {
    fill: none;
    stroke-width: 12;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.6s ease-in-out;
}

.metric-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
}


/* ===================================
   RESPONSIVE FIXES FOR ISSUE-COUNT & CATEGORY-ISSUES
   =================================== */

/* Mobile: Stack issue counts vertically */
@media (max-width: 767px) {
    .category-issues {
        flex-wrap: wrap;
        gap: 4px;
    }

    .issue-count {
        font-size: 10px;
        padding: 2px 6px;
        white-space: nowrap;
    }
}

/* Ensure issue-count badges don't overflow */
.issue-count {
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

/* Tablet and up: better spacing */
@media (min-width: 768px) {
    .category-issues {
        gap: 8px;
    }
}

/* ===================================
   STICKY NAVIGATION
   =================================== */
.sticky-nav {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 72px !important; /* Offset for desktop dashboard header */
    z-index: 40 !important;
    background: rgba(15, 23, 42, 0.98) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
}

@media (max-width: 640px) {
    .sticky-nav {
        top: 56px !important; /* Offset for mobile compact header */
    }

    #tabNavigation {
        display: flex !important;
        flex-direction: row !important;
        background: #1e293b !important;
        padding: 4px !important;
        border-radius: 12px !important;
        gap: 4px !important;
        border: none !important;
    }

    .tab-button {
        flex: 1 !important;
        padding: 10px 4px !important;
        font-size: 0.75rem !important;
        border-bottom: none !important;
        border-radius: 8px !important;
        text-align: center !important;
        white-space: nowrap !important;
        color: #94a3b8 !important;
        background: transparent !important;
    }

    .tab-button.active {
        background: linear-gradient(135deg, #44adf7 0%, #8761f6 100%) !important;
        color: white !important;
        box-shadow: 0 2px 6px rgba(68, 173, 247, 0.4) !important;
        font-weight: 700 !important;
    }
}

/* ===================================
   MOBILE AUTH BUTTONS & PANEL
   =================================== */
@media (max-width: 767px) {
    .auth-container {
        gap: 6px !important;
    }

    .auth-btn, .auth-username {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        max-width: 40px !important;
        padding: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 10px !important;
        aspect-ratio: 1 / 1 !important;
        overflow: hidden !important;
        flex-shrink: 0 !important;
        box-sizing: border-box !important;
    }
    
    .auth-btn span, .auth-username span {
        display: none !important;
    }
    
    .auth-btn i, .auth-username i {
        margin: 0 !important;
        font-size: 1.1rem !important;
    }

    header .absolute.top-2.right-2 {
        top: 10px !important;
        right: 10px !important;
    }
}

/* ===================================
   MOBILE SITEMAP TABLE (Card View)
   =================================== */
@media (max-width: 768px) {
    .sitemap-table {
        display: block !important;
        width: 100% !important;
        border: none !important;
    }
    
    .sitemap-table thead {
        display: none !important;
    }
    
    .sitemap-table tbody {
        display: block !important;
        width: 100% !important;
    }
    
    .sitemap-table tr.result-row {
        display: block !important;
        background: #0F172A !important;
        margin-bottom: 20px !important;
        border-radius: 16px !important;
        border: 1px solid #e2e8f0 !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
        padding: 16px !important;
        position: relative !important;
    }
    
    .sitemap-table td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 12px 0 !important;
        border-bottom: 1px solid #f1f5f9 !important;
        width: 100% !important;
        text-align: right !important;
        font-size: 0.95rem !important;
        color: #1e293b !important;
    }
    
    .sitemap-table td:last-child {
        border-bottom: none !important;
    }
    
    .sitemap-table td:first-child {
        display: block !important;
        text-align: left !important;
        border-bottom: 2px solid #f1f5f9 !important;
        padding-bottom: 16px !important;
        margin-bottom: 8px !important;
        background: transparent !important;
    }
    
    .sitemap-table td:first-child .truncate {
        white-space: normal !important;
        word-break: break-all !important;
        font-weight: 800 !important;
        color: #0f172a !important;
        font-size: 1rem !important;
    }

    /* Labels color fix - much darker for visibility */
    .sitemap-table td:nth-child(2)::before { content: "SEO Score"; font-weight: 700; color: #334155; text-transform: uppercase; font-size: 0.7rem; }
    .sitemap-table td:nth-child(3)::before { content: "Performance"; font-weight: 700; color: #334155; text-transform: uppercase; font-size: 0.7rem; }
    .sitemap-table td:nth-child(4)::before { content: "Load Time"; font-weight: 700; color: #334155; text-transform: uppercase; font-size: 0.7rem; }
    .sitemap-table td:nth-child(5)::before { content: "Status"; font-weight: 700; color: #334155; text-transform: uppercase; font-size: 0.7rem; }
    .sitemap-table td:nth-child(6)::before { content: "Issues"; font-weight: 700; color: #334155; text-transform: uppercase; font-size: 0.7rem; }

    /* Fix expansion logic: remove display:block !important to respect inline style="display:none" */
    .sitemap-table tr.details-row {
        display: none; 
        border-top: none !important;
        border-radius: 0 0 16px 16px !important;
        background: #f8fafc !important;
        padding: 0 !important;
        border: 1px solid #e2e8f0 !important;
        border-top: none !important;
        margin-top: -21px !important;
        margin-bottom: 20px !important;
    }
    
    /* When style="display: table-row" is added by JS, this will take over */
    .sitemap-table tr.details-row[style*="display: table-row"],
    .sitemap-table tr.details-row[style*="display: block"] {
        display: block !important;
    }
    
    .sitemap-table tr.details-row td {
        padding: 20px 16px !important;
        display: block !important;
        text-align: left !important;
    }
    
    .sitemap-table tr.details-row td::before {
        display: none !important;
    }
}


/* Shared action controls, matching dashboard actions. */
:is(.btn-primary, .cta-button, .magic-button, .auth-btn.primary,
    button.bg-brand-primary, a.bg-brand-primary, button.bg-brand-accent, a.bg-brand-accent) {
    background: rgba(2,132,199,.20) !important;
    border: 1px solid rgba(2,132,199,.40) !important;
    color: #38bdf8 !important;
    border-radius: 8px;
    box-shadow: none !important;
    font-weight: 600;
    cursor: pointer;
    transform: none !important;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
:is(.btn-primary, .cta-button, .magic-button, .auth-btn.primary,
    button.bg-brand-primary, a.bg-brand-primary, button.bg-brand-accent, a.bg-brand-accent):hover {
    background: rgba(2,132,199,.30) !important;
    border-color: rgba(56,189,248,.55) !important;
    color: #7dd3fc !important;
}
:is(.cta-button, .magic-button)::before,
:is(.cta-button, .magic-button)::after { display: none !important; }

/* Premium CTA is intentionally distinct from standard blue actions. */
.premium-upgrade-btn {
    background: rgba(250,204,21,.14);
    border: 1px solid rgba(250,204,21,.52);
    color: #fde68a;
    box-shadow: 0 0 16px rgba(250,204,21,.16), inset 0 1px 0 rgba(255,255,255,.08);
    transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}
.premium-upgrade-btn:hover {
    background: rgba(250,204,21,.22);
    border-color: rgba(253,224,71,.78);
    color: #fef3c7;
    box-shadow: 0 0 22px rgba(250,204,21,.28), 0 0 40px rgba(250,204,21,.10), inset 0 1px 0 rgba(255,255,255,.10);
}
.premium-upgrade-btn:active {
    background: rgba(250,204,21,.28);
    box-shadow: 0 0 14px rgba(250,204,21,.22);
}

/* Keep pricing-style Pro CTAs yellow/orange instead of the shared blue action style. */
.btn-primary.bg-gradient-to-r.from-yellow-400.to-orange-400 {
    background: linear-gradient(90deg, #facc15 0%, #fb923c 100%) !important;
    border: 1px solid rgba(250,204,21,.48) !important;
    color: #fff !important;
    box-shadow: 0 0 16px rgba(250,204,21,.16), 0 8px 22px rgba(249,115,22,.12) !important;
}
.btn-primary.bg-gradient-to-r.from-yellow-400.to-orange-400:hover {
    background: linear-gradient(90deg, #eab308 0%, #f97316 100%) !important;
    border-color: rgba(253,224,71,.72) !important;
    color: #fff !important;
    box-shadow: 0 0 22px rgba(250,204,21,.24), 0 10px 28px rgba(249,115,22,.16) !important;
}

:is(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 2px solid #38bdf8 !important;
    outline-offset: 3px;
}
button:disabled, button[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.tab-button.active {
    color: #7dd3fc !important;
    border-bottom-color: #38bdf8 !important;
    background: rgba(2,132,199,.20) !important;
    box-shadow: none !important;
}
.peer:checked ~ [class*="peer-checked:bg-brand-primary"] {
    background: #0284c7 !important;
    color: white !important;
}
footer #newsletterEmail { min-width: 0; }

/* Dashboard typography primitives. */
.dashboard-empty-title {
    margin: 0 0 .25rem;
    color: rgba(255,255,255,.60);
    font-size: .875rem;
    line-height: 1.25rem;
    font-weight: 500;
}
.dashboard-empty-subtitle {
    margin-left: auto;
    margin-right: auto;
    max-width: 28rem;
    color: rgba(255,255,255,.30);
    font-size: .75rem;
    line-height: 1rem;
}
.dashboard-subsection-title {
    color: #e2e8f0;
    font-size: .875rem;
    line-height: 1.25rem;
    font-weight: 700;
}
.dashboard-modal-title {
    color: #fff;
    font-size: 1rem;
    line-height: 1.5rem;
    font-weight: 700;
}

/* ===================================
   ACCESSIBILITY - SKIP LINK
   =================================== */

/* Make skip-to-content link visible on keyboard focus */
a.sr-only:focus-visible {
    position: fixed;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 9999;
    width: auto;
    height: auto;
    padding: 0.625rem 1.25rem;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background: var(--color-primary);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    outline: 3px solid #fff;
    outline-offset: 2px;
    text-decoration: none;
}

/* ===================================
   ACCESSIBILITY - REDUCED MOTION
   =================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    /* Keep will-change from consuming GPU for static elements */
    .animate-float-glow,
    .animate-scan-line,
    [class*="animate-"] {
        will-change: auto !important;
    }
}

/* Global gradient utility */
.bg-insights-gradient {
    background: linear-gradient(135deg, #60A5FA, #8B5CF6);
}
