/* ========================================
   SEO GrowMedia - Estilos principales
   ======================================== */

/* Variables CSS */
:root {
    --primary-color: #4285F4;
    --primary-dark: #3367D6;
    --secondary-color: #34A853;
    --danger-color: #EA4335;
    --warning-color: #FBBC05;
    --dark-color: #1a1a2e;
    --gray-dark: #2d2d44;
    --gray-medium: #4a4a6a;
    --gray-light: #8888a8;
    --light-color: #f5f5f7;
    --white: #ffffff;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --box-shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.2);
    --transition: all 0.3s ease;
}

/* Reset y Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--light-color);
    color: var(--dark-color);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* Utilidades */
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }
.text-muted { color: var(--gray-light); }
.text-error { color: var(--danger-color); }

/* Contenedor */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================
   Página de Login
   ======================================== */
.login-page {
    background: linear-gradient(135deg, var(--dark-color) 0%, var(--gray-dark) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-box {
    background: var(--white);
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--box-shadow-lg);
    text-align: center;
}

.login-header h1 {
    font-size: 1.8rem;
    color: var(--dark-color);
    margin-bottom: 8px;
}

.login-header p {
    color: var(--gray-light);
    margin-bottom: 30px;
}

.login-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.login-footer p {
    color: var(--gray-light);
    font-size: 0.85rem;
}

/* ========================================
   Alertas
   ======================================== */
.alert {
    padding: 12px 16px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.alert-error {
    background-color: #fef2f2;
    color: var(--danger-color);
    border: 1px solid #fecaca;
}

.alert-success {
    background-color: #f0fdf4;
    color: var(--secondary-color);
    border: 1px solid #bbf7d0;
}

/* ========================================
   Botones
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-google {
    width: 100%;
    background-color: var(--white);
    color: var(--dark-color);
    border: 2px solid #e5e5e5;
    padding: 14px 24px;
}

.btn-google:hover {
    background-color: #f8f8f8;
    border-color: #d0d0d0;
    color: var(--dark-color);
}

.google-icon {
    width: 20px;
    height: 20px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    color: var(--white);
}

.btn-secondary {
    background-color: #e5e5e5;
    color: var(--dark-color);
}

.btn-secondary:hover {
    background-color: #d0d0d0;
}

.btn-danger {
    background-color: var(--danger-color);
    color: var(--white);
}

.btn-danger:hover {
    background-color: #c5221f;
}

.btn-logout {
    background-color: transparent;
    color: var(--gray-light);
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-logout:hover {
    color: var(--danger-color);
}

/* ========================================
   Header
   ======================================== */
.header {
    background: var(--white);
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.header-brand h1 {
    font-size: 1.4rem;
    color: var(--dark-color);
}

.header-nav ul {
    display: flex;
    list-style: none;
    gap: 20px;
}

.header-nav a {
    color: var(--gray-medium);
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--border-radius);
}

.header-nav a:hover,
.header-nav a.active {
    color: var(--primary-color);
    background-color: rgba(66, 133, 244, 0.1);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.user-name {
    color: var(--dark-color);
    font-weight: 500;
}

/* ========================================
   Main Content
   ======================================== */
.main {
    padding: 30px 0;
    min-height: calc(100vh - 140px);
}

.page-header {
    margin-bottom: 30px;
}

.page-header h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.page-header p {
    color: var(--gray-light);
}

/* ========================================
   Cards
   ======================================== */
.card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.card-header h3 {
    font-size: 1.1rem;
    color: var(--dark-color);
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    background-color: #fafafa;
}

/* ========================================
   Empty State
   ======================================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--box-shadow);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.empty-state h2 {
    margin-bottom: 10px;
    color: var(--dark-color);
}

.empty-state p {
    color: var(--gray-light);
    margin-bottom: 20px;
}

/* ========================================
   Ajustes - Cuentas
   ======================================== */
.accounts-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.account-item {
    border: 1px solid #eee;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.account-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #fafafa;
}

.account-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.account-actions {
    display: flex;
    gap: 8px;
}

.account-sites {
    padding: 15px;
    border-top: 1px solid #eee;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 0.75rem;
    border-radius: 20px;
    background: #e5e5e5;
    color: var(--gray-medium);
}

.badge-success {
    background: #d1fae5;
    color: var(--secondary-color);
}

/* Sites Grid */
.sites-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.site-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f9f9f9;
    border-radius: var(--border-radius);
    border: 1px solid #eee;
}

.site-item.enabled {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.site-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.site-url {
    font-weight: 500;
    color: var(--dark-color);
}

.site-permission {
    font-size: 0.8rem;
    color: var(--gray-light);
}

/* Toggle Switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle input:checked + .toggle-slider {
    background-color: var(--secondary-color);
}

.toggle input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* ========================================
   Dashboard - Site Rows
   ======================================== */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.dashboard-title h2 {
    font-size: 1.6rem;
    margin-bottom: 5px;
}

.dashboard-title p {
    color: var(--gray-light);
}

.dashboard-actions .btn-icon {
    display: inline-block;
}

.dashboard-actions .btn-icon.spinning {
    animation: spin 1s linear infinite;
}

/* ========================================
   Table of Contents / Quick Summary
   ======================================== */
.sites-toc {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--box-shadow);
    padding: 20px;
    margin-bottom: 25px;
}

.toc-title {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--dark-color);
}

.toc-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--gray-light);
    padding: 10px 0;
}

.toc-table {
    width: 100%;
    border-collapse: collapse;
}

.toc-table th {
    text-align: left;
    padding: 10px 12px;
    background: var(--gray-lighter);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--gray-light);
}

.toc-table th:first-child {
    border-radius: 6px 0 0 0;
}

.toc-table th:last-child {
    border-radius: 0 6px 0 0;
}

.toc-table td {
    padding: 12px;
    border-bottom: 1px solid var(--gray-lighter);
    font-size: 0.9rem;
}

.toc-table tbody tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

.toc-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.toc-link:hover {
    text-decoration: underline;
}

.toc-table .toc-clicks,
.toc-table .toc-impressions {
    font-weight: 600;
}

.toc-table .toc-clicks {
    color: #1976d2;
}

.toc-table .toc-impressions {
    color: #7b1fa2;
}

.toc-table .toc-ctr {
    color: var(--secondary-color);
}

.toc-table .toc-position {
    color: var(--gray-dark);
}

/* Trend indicators */
.trend-up {
    color: #2e7d32;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.trend-down {
    color: #c62828;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.trend-neutral {
    color: var(--gray-light);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.trend-arrow {
    font-size: 1.1em;
}

.trend-value {
    font-size: 0.85rem;
}

.trend-loading {
    opacity: 0.5;
}

/* Responsive TOC */
@media (max-width: 768px) {
    .toc-table {
        font-size: 0.8rem;
    }
    
    .toc-table th,
    .toc-table td {
        padding: 8px 6px;
    }
    
    .toc-table th:nth-child(3),
    .toc-table td:nth-child(3),
    .toc-table th:nth-child(4),
    .toc-table td:nth-child(4) {
        display: none;
    }
}

.sites-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.site-row {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--box-shadow);
    overflow: visible;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    scroll-margin-top: 20px;
}

.site-row-highlight {
    box-shadow: 0 0 0 3px var(--primary-color), var(--box-shadow);
    animation: highlight-pulse 0.5s ease-out;
}

@keyframes highlight-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.005); }
    100% { transform: scale(1); }
}

.site-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: linear-gradient(135deg, var(--dark-color) 0%, var(--gray-dark) 100%);
    color: white;
}

.site-row-info h3 {
    font-size: 1.2rem;
    margin-bottom: 4px;
    word-break: break-all;
}

.site-row-info .site-account {
    font-size: 0.85rem;
    opacity: 0.7;
}

.site-row-status .loading-text {
    font-size: 0.85rem;
    opacity: 0.8;
}

.cache-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.15);
}

.cache-badge.fresh {
    background: rgba(52, 168, 83, 0.3);
}

.cache-badge.error {
    background: rgba(234, 67, 53, 0.3);
}

.site-row-chart {
    padding: 20px 25px;
    height: 300px;
    background: #fafafa;
    border-bottom: 1px solid #eee;
}

.site-row-chart canvas {
    width: 100% !important;
    height: 100% !important;
}

.site-row-metrics {
    padding: 25px;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.metrics-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    width: 100%;
}

.metric {
    text-align: center;
}

.metric-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark-color);
}

.metric-value.clicks {
    color: #1976d2;
}

.metric-value.impressions {
    color: #7b1fa2;
}

.metric-label {
    font-size: 0.85rem;
    color: var(--gray-light);
    margin-top: 4px;
}

.metrics-period {
    margin-top: 20px;
    font-size: 0.8rem;
    color: var(--gray-light);
    text-align: center;
    width: 100%;
}

/* ========================================
   Combined Metrics (Google + Bing)
   ======================================== */
.metrics-combined {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.metrics-row {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 8px;
    background: #f8f9fa;
}

.metrics-row.google {
    background: linear-gradient(135deg, rgba(25, 118, 210, 0.08) 0%, rgba(25, 118, 210, 0.03) 100%);
    border-left: 3px solid #1976d2;
}

.metrics-row.bing {
    background: linear-gradient(135deg, rgba(0, 131, 115, 0.08) 0%, rgba(0, 131, 115, 0.03) 100%);
    border-left: 3px solid #008373;
}

.metrics-row.total {
    background: linear-gradient(135deg, rgba(100, 100, 100, 0.08) 0%, rgba(100, 100, 100, 0.03) 100%);
    border-left: 3px solid #666;
}

.metrics-source {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 90px;
    font-weight: 600;
    font-size: 0.9rem;
}

.source-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
}

.source-icon.google {
    background: #1976d2;
}

.source-icon.bing {
    background: #008373;
}

.source-icon.total {
    background: #666;
    font-size: 0.7rem;
}

.metrics-row .metrics-grid-4 {
    flex: 1;
    gap: 20px;
}

.metrics-row .metric-value {
    font-size: 1.4rem;
}

/* Source badges */
.source-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 8px;
}

.source-badge.google {
    background: rgba(25, 118, 210, 0.15);
    color: #1976d2;
}

.source-badge.bing {
    background: rgba(0, 131, 115, 0.15);
    color: #008373;
}

/* Country badge */
.country-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    background: linear-gradient(135deg, #4285F4 0%, #34A853 100%);
    color: white;
    margin-left: 10px;
    border: 1px solid rgba(66, 133, 244, 0.3);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.country-badge:hover {
    background: linear-gradient(135deg, #3367D6 0%, #2d8f44 100%);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Bing buttons */
.btn-bing {
    background: linear-gradient(135deg, #008373 0%, #006d5b 100%);
    color: white;
}

.btn-bing:hover {
    background: linear-gradient(135deg, #006d5b 0%, #005a4a 100%);
    transform: translateY(-1px);
}

/* DataForSEO buttons and styles */
.btn-dataforseo {
    background: linear-gradient(135deg, #FF6B35 0%, #e55a2b 100%);
    color: white;
}

.btn-dataforseo:hover {
    background: linear-gradient(135deg, #e55a2b 0%, #cc4a1f 100%);
    transform: translateY(-1px);
}

.dataforseo-icon-sm {
    vertical-align: middle;
    margin-right: 5px;
}

.dataforseo-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.dataforseo-usage {
    padding: 15px;
    background: #f8f9fa;
    border-radius: var(--border-radius);
    border: 1px solid #e5e7eb;
}

.dataforseo-usage h5 {
    margin: 0 0 5px;
    font-size: 0.875rem;
    color: var(--gray-dark);
}

/* OpenAI buttons and styles */
.btn-openai {
    background: linear-gradient(135deg, #10a37f 0%, #0d8a6a 100%);
    color: white;
}

.btn-openai:hover {
    background: linear-gradient(135deg, #0d8a6a 0%, #0a7358 100%);
    transform: translateY(-1px);
}

/* Email button */
.btn-email {
    background: linear-gradient(135deg, #ea4335 0%, #c5221f 100%);
    color: white;
    border: none;
}

.btn-email:hover {
    background: linear-gradient(135deg, #c5221f 0%, #a31b18 100%);
    transform: translateY(-1px);
    color: white;
}

.btn-email:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Danger/Regenerate button */
.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #b02a37 100%);
    color: white;
    border: none;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #b02a37 0%, #8b2131 100%);
    transform: translateY(-1px);
    color: white;
}

.btn-danger.btn-sm {
    padding: 5px 10px;
    font-size: 0.8rem;
}

.openai-icon-sm {
    vertical-align: middle;
    margin-right: 5px;
}

.openai-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.form-vertical {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 500px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

.badge-primary {
    background: var(--primary-color);
    color: white;
}

/* Competitors section in dashboard */
.btn-competitors {
    background: linear-gradient(135deg, #FF6B35 0%, #e55a2b 100%);
    color: white;
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-competitors:hover {
    background: linear-gradient(135deg, #e55a2b 0%, #cc4a1f 100%);
    transform: translateY(-1px);
}

.btn-competitors.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Reports button */
.btn-reports {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-reports:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    transform: translateY(-1px);
}

/* Cost badge */
.cost-badge {
    display: inline-block;
    background: #fff3cd;
    color: #856404;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 5px;
}

.cost-badge.cached {
    background: #d4edda;
    color: #155724;
}

/* Competitors modal */
.competitors-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.competitors-modal.active {
    opacity: 1;
    visibility: visible;
}

.competitors-modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.competitors-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.competitors-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.competitors-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    line-height: 1;
}

.competitors-modal-close:hover {
    color: #000;
}

.competitors-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* Competitors table */
.competitors-table {
    width: 100%;
    border-collapse: collapse;
}

.competitors-table th,
.competitors-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.competitors-table th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gray-dark);
}

.competitors-table tr:hover {
    background: #f8f9fa;
}

.competitor-domain {
    font-weight: 500;
    color: var(--primary-color);
}

.competitor-domain-link {
    font-weight: 500;
    color: var(--primary-color);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.competitor-domain-link:hover {
    text-decoration: underline;
    color: var(--primary-color-dark, #0056b3);
}

.competitor-domain-link svg {
    opacity: 0.5;
    flex-shrink: 0;
}

.competitor-domain-link:hover svg {
    opacity: 1;
}

/* Current domain highlight (el dominio que estamos analizando) */
.competitor-domain-link.current-domain {
    color: #e65100;
    font-weight: 700;
}

.competitor-domain-link.current-domain:hover {
    color: #bf360c;
}

.current-domain-row {
    background: linear-gradient(90deg, rgba(230, 81, 0, 0.08) 0%, transparent 100%);
}

.current-badge {
    background: #e65100;
    color: white;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Domain cell with buttons */
.domain-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* WordPress/CMS indicator */
.wp-indicator {
    display: inline-flex;
    align-items: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.wp-indicator .wp-loading {
    font-size: 0.75rem;
}

.wp-indicator .wp-badge {
    cursor: help;
    display: inline-flex;
    align-items: center;
}

.wp-indicator .wp-badge .wp-icon {
    width: 17px;
    height: 17px;
}

.wp-icon-legend {
    vertical-align: middle;
    margin-right: 2px;
}

.wp-indicator .cms-badge {
    cursor: help;
    opacity: 0.7;
}

.wp-indicator .no-cms-badge {
    cursor: help;
    opacity: 0.5;
}

.wp-indicator .cache-sup {
    font-size: 0.5rem;
    vertical-align: super;
    margin-left: -2px;
}

.wp-indicator.is-wordpress .wp-badge {
    animation: pulse-wp 2s ease-in-out infinite;
}

@keyframes pulse-wp {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Sitemap actions column */
.col-actions {
    width: 80px;
    min-width: 80px;
    text-align: center;
}

.col-action-sm {
    width: 45px;
    min-width: 45px;
    text-align: center;
    padding: 8px 4px !important;
}

.col-action-sm button {
    margin: 0 auto;
}

.sitemap-actions {
    display: inline-flex;
    gap: 4px;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
}

/* Competitors footer */
.competitors-footer {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Button for sitemap/URLs link */
.btn-sitemap-link {
    background: none;
    border: 1px solid #9c27b0;
    color: #9c27b0;
    padding: 3px 6px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-sitemap-link:hover {
    background: #9c27b0;
    color: white;
}

.btn-sitemap-link.cached {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.btn-sitemap-link.cached:hover {
    background: var(--secondary-color);
    color: white;
}

.btn-sitemap-link svg {
    width: 12px;
    height: 12px;
}

/* Button for compare sitemaps */
.btn-compare-link {
    background: none;
    border: 1px solid #10a37f;
    color: #10a37f;
    padding: 3px 6px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-compare-link:hover {
    background: linear-gradient(135deg, #10a37f, #1a7f64);
    color: white;
}

.btn-compare-link.cached {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.btn-compare-link.cached:hover {
    background: var(--secondary-color);
    color: white;
}

.btn-compare-link svg {
    width: 12px;
    height: 12px;
}

/* Button for keywords link */
.btn-keywords-link {
    background: none;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

.btn-keywords-link:hover {
    background: var(--primary-color);
    color: white;
}

.btn-keywords-link svg {
    opacity: 0.7;
}

.btn-keywords-link:hover svg {
    opacity: 1;
}

.btn-keywords-link .cache-indicator {
    font-size: 0.75rem;
    margin-left: 2px;
}

.btn-keywords-link.cached {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.btn-keywords-link.cached:hover {
    background: var(--secondary-color);
    color: white;
}

/* Keywords table */
.keywords-table .url-cell {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.keywords-table .url-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.85rem;
}

.keywords-table .url-link:hover {
    text-decoration: underline;
}

/* Sitemap table */
.sitemap-table .url-cell {
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sitemap-table .url-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.sitemap-table .url-link:hover {
    text-decoration: underline;
}

.sitemap-table .url-link svg {
    opacity: 0.5;
    flex-shrink: 0;
}

.sitemap-table .url-link:hover svg {
    opacity: 1;
}

.sitemap-info {
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: var(--border-radius);
    border-left: 4px solid #9c27b0;
}

.sitemap-filter {
    position: sticky;
    top: 0;
    background: white;
    padding: 5px 0;
    z-index: 10;
}

.sitemap-filter input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
}

.sitemap-filter input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2);
}

.sitemap-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-medium);
    color: var(--gray-dark);
}

.btn-outline:hover {
    background: var(--gray-light);
    color: white;
}

.competitor-metric {
    font-weight: 600;
}

.competitor-metric.good {
    color: var(--success-color);
}

.competitor-metric.warning {
    color: var(--warning-color);
}

/* Confirmation dialog */
.confirm-dialog {
    background: white;
    border-radius: 12px;
    padding: 25px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.confirm-dialog h4 {
    margin: 0 0 10px;
    font-size: 1.1rem;
}

.confirm-dialog p {
    color: #666;
    margin-bottom: 20px;
}

.confirm-dialog .cost-display {
    font-size: 1.5rem;
    font-weight: 700;
    color: #FF6B35;
    margin: 15px 0;
}

.confirm-dialog .buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* ========================================
   Evolution Section (Position Changes)
   ======================================== */
.site-row-evolution {
    padding: 20px 25px;
    border-top: 1px solid #eee;
    background: linear-gradient(135deg, #fafbfc 0%, #f0f2f5 100%);
}

.evolution-section h4 {
    font-size: 1rem;
    color: var(--dark-color);
    margin-bottom: 15px;
    font-weight: 600;
}

.evolution-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.evolution-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid #e5e7eb;
}

.evolution-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 5px;
}

.evolution-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-medium);
}

.evolution-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    white-space: nowrap;
}

.evolution-badge.positive {
    background: #dcfce7;
    color: #166534;
}

.evolution-badge.negative {
    background: #fee2e2;
    color: #991b1b;
}

.evolution-badge.neutral {
    background: #f3f4f6;
    color: #6b7280;
}

.evolution-values {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.evolution-start,
.evolution-end {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.evolution-period {
    font-size: 0.65rem;
    color: var(--gray-light);
    margin-bottom: 3px;
    text-align: center;
}

.evolution-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark-color);
}

.evolution-arrow {
    color: var(--gray-light);
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* ========================================
   Site Row Tables (Keywords & Pages)
   ======================================== */
.site-row-tables {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    border-top: 1px solid #eee;
}

.site-row-tables.full-width {
    grid-template-columns: 1fr;
}

.site-row-tables.full-width .table-section:first-child {
    border-right: none;
    border-bottom: 1px solid #eee;
}

.table-section {
    padding: 20px 25px;
}

.table-section:first-child {
    border-right: 1px solid #eee;
}

.table-section h4 {
    font-size: 1rem;
    color: var(--dark-color);
    margin-bottom: 15px;
}

.table-container {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

.table-container .data-table {
    min-width: 550px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.data-table thead {
    background: #f5f5f7;
}

.data-table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--gray-medium);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #eee;
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    color: var(--dark-color);
}

.data-table tbody tr:hover {
    background: #fafafa;
}

.data-table .col-keyword,
.data-table .col-url {
    max-width: 250px;
}

.data-table .col-num {
    text-align: right;
    white-space: nowrap;
    width: 70px;
}

.data-table .col-num.clicks {
    color: #1976d2;
    font-weight: 600;
}

.rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: #e8e8e8;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gray-medium);
    margin-right: 8px;
    flex-shrink: 0;
}

.keyword-text {
    display: inline-block;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.url-text {
    display: inline-block;
    word-break: break-all;
    vertical-align: middle;
    color: var(--primary-color);
    text-decoration: none;
}

.url-text:hover {
    text-decoration: underline;
}

/* Tabla con evolución */
.table-scroll {
    overflow-x: auto;
    max-width: 100%;
}

.data-table-evolution {
    min-width: 1200px;
}

.data-table-evolution th.col-group {
    text-align: center;
    background: #e8eaf6;
    border-bottom: 1px solid #c5cae9;
    font-size: 0.7rem;
    padding: 8px 6px;
}

.data-table-evolution th.col-group:nth-child(2) {
    background: #e3f2fd;
}

.data-table-evolution th.col-group:nth-child(3) {
    background: #e8f5e9;
}

.data-table-evolution th.col-group:nth-child(4) {
    background: #fff3e0;
}

.data-table-evolution th.col-group:nth-child(5) {
    background: #fce4ec;
}

.data-table-evolution th.sub {
    font-size: 0.65rem;
    padding: 6px 4px;
    background: #f5f5f5;
}

.data-table-evolution .col-num {
    width: 55px;
    font-size: 0.75rem;
    padding: 8px 4px;
}

.data-table-evolution .col-keyword,
.data-table-evolution .col-url {
    min-width: 180px;
    max-width: 220px;
    position: sticky;
    left: 0;
    background: white;
    z-index: 1;
}

.data-table-evolution thead th.col-keyword,
.data-table-evolution thead th.col-url {
    background: #f5f5f7;
}

.data-table-evolution tbody tr:hover .col-keyword,
.data-table-evolution tbody tr:hover .col-url {
    background: #fafafa;
}

/* Clases para cambios */
.change-positive {
    color: #166534 !important;
    font-weight: 600;
    background: #dcfce7 !important;
}

.change-negative {
    color: #991b1b !important;
    font-weight: 600;
    background: #fee2e2 !important;
}

.change-neutral {
    color: #6b7280;
}

.loading-spinner-sm {
    width: 20px;
    height: 20px;
    border: 2px solid #eee;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

/* Legacy dashboard grid - keep for compatibility */
.sites-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.site-card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

.site-card-header {
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.site-card-header h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    word-break: break-all;
}

.site-account {
    font-size: 0.8rem;
    opacity: 0.8;
}

.site-card-metrics {
    padding: 20px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    width: 100%;
}

/* Loading */
.loading, .loading-spinner {
    color: var(--gray-light);
}

.loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #eee;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    background: var(--dark-color);
    color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-success {
    background: var(--secondary-color);
}

.toast-error {
    background: var(--danger-color);
}

/* ========================================
   Footer
   ======================================== */
.footer {
    background: var(--white);
    padding: 20px 0;
    text-align: center;
    border-top: 1px solid #eee;
}

.footer p {
    color: var(--gray-light);
    font-size: 0.9rem;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .header-nav {
        order: 3;
        width: 100%;
    }
    
    .header-nav ul {
        justify-content: center;
    }
    
    .user-name {
        display: none;
    }
    
    .sites-list {
        gap: 20px;
    }
    
    .site-row-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .site-row-chart {
        height: 250px;
        padding: 15px;
    }
    
    .metrics-grid-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .metric-value {
        font-size: 1.4rem;
    }
    
    .evolution-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .site-row-tables {
        grid-template-columns: 1fr;
    }
    
    .table-section:first-child {
        border-right: none;
        border-bottom: 1px solid #eee;
    }
    
    .table-section {
        padding: 15px;
        overflow: visible;
    }
    
    .table-container {
        overflow-x: scroll;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        padding-bottom: 10px;
    }
    
    .table-container .data-table {
        min-width: 550px;
        width: max-content;
    }
    
    .keyword-text,
    .url-text {
        max-width: 180px;
    }
}

@media (max-width: 480px) {
    .evolution-grid {
        grid-template-columns: 1fr;
    }
    
    .evolution-card {
        padding: 12px;
    }
    
    .evolution-value {
        font-size: 1rem;
    }
    
    .table-section {
        padding: 12px 10px;
    }
    
    .table-container .data-table {
        min-width: 520px;
    }
    
    .table-section h4::after {
        content: ' ← desliza →';
        font-size: 0.7rem;
        color: #999;
        font-weight: normal;
    }
}

/* ================================================
   ANÁLISIS IA DE URLs
   ================================================ */

.analysis-summary {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.summary-stat {
    background: var(--gray-light);
    border-radius: 10px;
    padding: 12px 20px;
    text-align: center;
    min-width: 100px;
}

.summary-stat .stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-dark);
}

.summary-stat .stat-label {
    display: block;
    font-size: 0.75rem;
    color: #666;
    margin-top: 3px;
}

.summary-stat.informational {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.summary-stat.informational .stat-value {
    color: #10b981;
}

.summary-stat.non-informational {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.summary-stat.non-informational .stat-value {
    color: #ef4444;
}

.summary-stat.percentage {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.summary-stat.percentage .stat-value {
    color: #3b82f6;
}

.patterns-section h5 {
    margin: 0 0 10px;
    font-size: 0.85rem;
    color: #666;
}

.patterns-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pattern-badge {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
}

.analysis-tabs {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.tab-btn {
    padding: 8px 16px;
    border: 1px solid var(--gray-medium);
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: var(--gray-light);
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.analysis-filter {
    display: flex;
    justify-content: center;
}

.analysis-filter input {
    width: 100%;
    max-width: 350px;
    padding: 8px 14px;
    border: 1px solid var(--gray-medium);
    border-radius: 20px;
    font-size: 0.85rem;
}

.analysis-filter input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.analysis-table .url-cell {
    max-width: 450px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.analysis-table .url-link {
    color: var(--gray-dark);
    text-decoration: none;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.analysis-table .url-link:hover {
    color: var(--primary-color);
}

.analysis-table .url-link svg {
    opacity: 0;
    transition: opacity 0.2s;
}

.analysis-table .url-link:hover svg {
    opacity: 1;
}

.informational-url {
    color: #10b981 !important;
}

.informational-url:hover {
    color: #059669 !important;
}

.non-informational-url {
    color: #ef4444 !important;
}

.non-informational-url:hover {
    color: #dc2626 !important;
}

.analysis-badge .cost-badge {
    cursor: pointer;
}

/* Botón re-analizar */
.btn-openai.btn-sm {
    font-size: 0.75rem;
    padding: 6px 12px;
}

/* ================================================
   COMPARACIÓN DE SITEMAPS
   ================================================ */

.comparison-vs {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.domain-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.domain-badge.my-domain {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
}

.domain-badge.competitor-domain {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.vs-text {
    font-weight: 700;
    color: #666;
    font-size: 0.85rem;
}

.comparison-summary {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.comparison-summary .summary-stat.warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.comparison-summary .summary-stat.warning .stat-value {
    color: #f59e0b;
}

.main-recommendation {
    background: linear-gradient(135deg, rgba(16, 163, 127, 0.1), rgba(59, 130, 246, 0.1));
    border: 1px solid rgba(16, 163, 127, 0.3);
    border-radius: 10px;
    padding: 15px;
}

.main-recommendation strong {
    color: #10a37f;
}

.main-recommendation p {
    margin: 8px 0 0;
    color: #333;
}

.comparison-tabs {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.opportunity-card,
.advantage-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 12px;
}

.opportunity-card:hover,
.advantage-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.opportunity-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.opportunity-header h5,
.advantage-header h5,
.advantage-card h5 {
    margin: 0;
    font-size: 0.95rem;
    color: #1f2937;
}

.opportunity-badges {
    display: flex;
    gap: 6px;
}

.effort-badge,
.impact-badge,
.priority-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
}

.effort-badge.easy { background: #d1fae5; color: #065f46; }
.effort-badge.medium { background: #fef3c7; color: #92400e; }
.effort-badge.hard { background: #fee2e2; color: #991b1b; }

.impact-badge.high { background: #d1fae5; color: #065f46; }
.impact-badge.medium { background: #dbeafe; color: #1e40af; }
.impact-badge.low { background: #f3f4f6; color: #4b5563; }

.priority-badge.high { background: #fee2e2; color: #991b1b; }
.priority-badge.medium { background: #fef3c7; color: #92400e; }
.priority-badge.low { background: #f3f4f6; color: #4b5563; }

.opportunity-card p,
.advantage-card p {
    margin: 0 0 10px;
    color: #4b5563;
    font-size: 0.85rem;
    line-height: 1.5;
}

.suggested-urls,
.example-urls {
    background: #f9fafb;
    border-radius: 6px;
    padding: 10px;
    margin-top: 10px;
}

.suggested-urls small,
.example-urls small {
    color: #6b7280;
}

.suggested-urls ul {
    margin: 5px 0 0;
    padding-left: 20px;
}

.suggested-urls li {
    margin-bottom: 4px;
}

.suggested-urls code {
    background: #e5e7eb;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.example-url {
    display: block;
    color: #3b82f6;
    text-decoration: none;
    font-size: 0.8rem;
    margin-top: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.example-url:hover {
    text-decoration: underline;
}

.advantage-card.competitor {
    border-left: 3px solid #ef4444;
}

.advantage-card.my {
    border-left: 3px solid #10b981;
}

.advantage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

/* ================================================
   INFORMES
   ================================================ */

.reports-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.report-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.report-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
    transform: translateY(-2px);
}

.report-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.report-info {
    flex: 1;
    min-width: 0;
}

.report-info h5 {
    margin: 0 0 8px;
    font-size: 0.95rem;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.report-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.75rem;
    color: #6b7280;
}

.report-meta span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.report-expires {
    font-size: 0.7rem;
    color: #10b981;
    margin-top: 5px;
}

.report-expires.warning {
    color: #f59e0b;
}

.report-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn-icon {
    background: none;
    border: 1px solid #e5e7eb;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.py-20 {
    padding-top: 40px;
    padding-bottom: 40px;
}

.url-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.url-list li {
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.85rem;
}

.url-list li:last-child {
    border-bottom: none;
}

.url-list a {
    color: #3b82f6;
    text-decoration: none;
}

.url-list a:hover {
    text-decoration: underline;
}

.report-detail-header {
    background: #f9fafb;
    padding: 12px 15px;
    border-radius: 8px;
}

@media (max-width: 600px) {
    .report-card {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    
    .report-icon {
        font-size: 1.5rem;
    }
    
    .report-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid #f0f0f0;
    }
    
    .report-meta {
        flex-direction: column;
        gap: 5px;
    }
}

/* ========================================
   Prompts de IA Personalizables
   ======================================== */
.prompt-editor {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
}

.prompt-header h5 {
    font-size: 1.1rem;
    color: var(--dark-color);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.prompt-header .text-sm {
    font-size: 0.85rem;
}

.prompt-textarea {
    width: 100%;
    max-width: 100%;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    padding: 15px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: var(--white);
    resize: vertical;
    min-height: 600px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.prompt-textarea:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.prompt-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.prompts-icon-sm {
    width: 20px;
    height: 20px;
    vertical-align: middle;
}

.btn-outline {
    background: transparent;
    border: 1px solid #d1d5db;
    color: var(--gray-medium);
}

.btn-outline:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-0 { margin-bottom: 0; }

.alert ul {
    padding-left: 20px;
}

.alert ul li {
    margin-bottom: 5px;
}

.alert code {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
}
