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

/* CSS Variables - Brand Colors from Logo */
:root {
    --color-primary: #9ba7ce;
    --color-primary-dark: #0b002b;
    --color-accent: #a9deff;
}

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

.auth-page {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: url('/static/images/bkgrnd.png') center center / cover no-repeat fixed, #1a1f3a;
}

.auth-overlay {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.1) 0%, rgba(124, 58, 237, 0.1) 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, #9ba7ce 0%, #0b002b 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, #a9deff 0%, #9ba7ce 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%, #a9deff 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, #9ba7ce, #a9deff, #9ba7ce);
    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(155, 167, 206, 0.4);
}

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

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

.error-section h4,
.warning-section h4 {
    color: #333;
    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: #555;
}

.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: #555;
    font-size: 0.875rem;
    margin-bottom: 20px;
    font-style: italic;
    text-align: center;
    padding: 10px;
    background: #e8f4fd;
    border-radius: 5px;
    border-left: 3px solid var(--color-primary);
}

.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: white;
    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: white;
    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: white;
    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: #555;
    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: #333;
    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(3, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.info-item {
    position: relative;
    transition: all 0.3s ease;
    padding: 10px 35px 10px 10px;  /* Extra right padding for icon */
    border-radius: 5px;
    background: white;
    border: 1px solid #e0e0e0;
}

.info-label {
    font-size: 0.875rem;
    color: #555;
    margin-bottom: 5px;
}

.info-value {
    font-weight: 600;
    color: #333;
    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: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    z-index: 10;
}

/* Info icon inside info-item (top right of card) */
.info-item > .info-icon {
    top: 8px;
    right: 8px;
}

/* 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 - centered above icon */
.info-icon[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-primary-dark);
    color: white;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    line-height: 1.5;
    white-space: normal;
    max-width: min(300px, calc(100vw - 60px));
    min-width: 100px;
    width: max-content;
    text-align: left;
    z-index: 999999;
    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;
    /* Add arrow using clip-path */
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Tooltip arrow using pseudo-element on after */
.info-icon[data-tooltip]::after {
    /* Keep previous styles and add pseudo-arrow using box-shadow trick */
}

.info-icon[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-2px);
}

.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 {
    border-left: 5px solid #10b981;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

.info-item.warning {
    border-left: 5px solid #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15);
}

.info-item.error {
    border-left: 5px solid #ef4444;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15);
}

.info-item.poor {
    border-left: 5px solid #dc2626;
    background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.15);
}

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

.detail-card.active {
    max-height: 400px;
    opacity: 1;
    margin-top: 16px;
    margin-bottom: 8px;
    padding: 20px;
    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 #e5e7eb;
}

.detail-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-primary-dark);
}

.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: white;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    color: #374151;
    border-left: 3px solid var(--color-primary);
}

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

/* Error, Warning, Success Items */
.error-item {
    padding: 8px 12px;
    background: #fee;
    border-left: 4px solid #f44;
    margin-bottom: 5px;
    border-radius: 3px;
    color: #c33;
    font-size: 1rem;
}

.warning-item {
    padding: 8px 12px;
    background: #fffbeb;
    border-left: 4px solid #ffc107;
    margin-bottom: 5px;
    border-radius: 3px;
    color: #856404;
    font-size: 1rem;
}

.success-item {
    padding: 8px 12px;
    background: #efe;
    border-left: 4px solid #4a4;
    margin-bottom: 5px;
    border-radius: 3px;
    color: #363;
    font-size: 1rem;
}

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

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #9ba7ce 0%, #0b002b 100%);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(155, 167, 206, 0.4);
    transition: all 0.25s ease-in-out;
    z-index: 1000;
    line-height: 1;
    padding: 0;
}

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

.back-to-top:hover {
    background: linear-gradient(135deg, #a9deff 0%, #9ba7ce 100%);
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 20px rgba(169, 222, 255, 0.5);
}

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

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

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

.cwv-container {
    background: #f8fafc;
    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: var(--color-primary-dark);
}

.cwv-tabs {
    display: flex;
    gap: 5px;
    background: #e5e7eb;
    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: #555;
    transition: all 0.25s ease-in-out;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cwv-tab:hover {
    background: rgba(155, 167, 206, 0.1);
    color: var(--color-primary);
}

.cwv-tab.active {
    background: var(--color-primary);
    color: white;
    box-shadow: 0 2px 4px rgba(155, 167, 206, 0.3);
}

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

.cwv-load-btn {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    margin: 15px auto;
}

.cwv-load-btn:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.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: #555;
}

.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: #ecfdf5;
    border-color: #10b981;
}

.cwv-score.warning {
    background: #fff3cd;
    border-color: #ffc107;
}

.cwv-score.poor {
    background: #fee;
    border-color: #f44;
}

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

.cwv-score-label {
    position: relative;
    font-size: 1.125rem;
    color: #555;
    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;
    border-left: 4px solid;
}

.cwv-metric.good {
    background: #ecfdf5;
    border-left-color: #10b981;
}

.cwv-metric.warning {
    background: #fff3cd;
    border-left-color: #ffc107;
}

.cwv-metric.poor {
    background: #fee;
    border-left-color: #f44;
}

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

.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: #555;
    margin-top: 5px;
}

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

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

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

.sitemap-report {
    background: white;
    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: #555;
    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: #555;
    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;
    background: white;
    font-size: 1rem;
    min-width: 900px;
}

.sitemap-table thead {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
}

.sitemap-table th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--color-accent);
    white-space: nowrap;
}

.sitemap-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.sitemap-table th.sortable:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sitemap-table th.sortable.active {
    background-color: rgba(255, 255, 255, 0.15);
}

.sort-icon {
    margin-left: 6px;
    font-size: 12px;
    opacity: 0.7;
}

.sitemap-table th.sortable.active .sort-icon {
    opacity: 1;
}

.sitemap-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.2s ease;
}

.sitemap-table tbody tr:hover {
    background-color: #f8f9fa;
}

.sitemap-table tbody tr:last-child {
    border-bottom: none;
}

.sitemap-table td {
    padding: 14px 12px;
    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: #f8fafc;
    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: white;
    border-left: 3px solid var(--color-accent);
    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: #555;
}

.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;
    }
    
    .sitemap-table {
        font-size: 12px;
    }
    
    .sitemap-table th,
    .sitemap-table td {
        padding: 10px 8px;
    }
    
    .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: white;
    border-radius: 12px;
    overflow: visible;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.seo-category:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.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-header:hover {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
}

.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: white;
    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;
}

/* ===================================
   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: var(--color-primary);
    border-bottom-color: var(--color-primary) !important;
}

.tab-button:not(.active):hover {
    color: #4b5563;
    border-bottom-color: #d1d5db;
}

.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;
        border-left: 3px solid transparent;
        padding-left: 12px;
    }

    .tab-button.active {
        border-left-color: var(--color-primary) !important;
        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);
    }
}
