/* RAIO AI Meta Tag Generator - Admin Styles - CON FILTROS */

.raio-meta-tag-generator { max-width: 1400px; }

/* CARD PRINCIPAL */
.card {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 30px;
    width: 100%;
    max-width: 100%;
}

.card h2 { margin: 0 0 15px 0; color: #0073aa; font-size: 28px; }
.card > p { color: #666; font-size: 16px; margin-bottom: 30px; line-height: 1.6; }

/* WORKFLOW STEPS */
.workflow-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin: 30px 0;
    padding: 0;
    width: 100%;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.step:hover {
    background: #e8f5ff;
    border-color: #0073aa;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,115,170,0.15);
}

.step-number {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(0,115,170,0.3);
}

.step-content h3 { margin: 0 0 8px 0; color: #0073aa; font-size: 16px; font-weight: 600; }
.step-content p { margin: 0; color: #666; font-size: 14px; line-height: 1.5; }

/* ========================================
   FILTROS
   ======================================== */
.filters-container {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 25px;
    border: 1px solid #e2e8f0;
    position: relative;
    z-index: 1;
}

.filters-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.filter-group {
    flex: 1 1 180px;
    max-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-radius: 10px;
}

.filter-group label {
    font-weight: 600;
    font-size: 13px;
    color: #374151;
    white-space: nowrap;
}

.filter-group select,
.filter-group input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.filter-group select:focus,
.filter-group input[type="text"]:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.filter-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
        margin-bottom: 20px;
}

#apply-filters {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    border: none;
    color: white;
    padding: 10px 20px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;

}

#apply-filters:hover {
    background: linear-gradient(135deg, #005a87 0%, #004466 100%);
}

#clear-filters {
    cursor: pointer;
}

.active-filters-badge {
    background: #0073aa;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* Responsive para filtros */
@media (max-width: 600px) {
    .filter-group {
        flex: 1 1 100%;
        max-width: 100%;
    }
    
    .filter-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    #apply-filters, #clear-filters {
        width: 100%;
    }
}
/* ========================================
   AUTHENTICATED HEADER
   ======================================== */
.authenticated-header {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: white;
    padding: 18px 25px;
    border-radius: 8px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 3px 10px rgba(0,115,170,0.25);
}

.user-info { display: flex; align-items: center; gap: 20px; font-size: 15px; font-weight: 500; }

/* ========================================
   POST ITEMS
   ======================================== */
.meta-row {
    border: 1px solid #ddd;
    margin: 15px 0;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    position: relative;
}

.meta-row:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.meta-row.has-ai-meta { border-left: 4px solid #00a651; background: #f0f8f0; }
.meta-row.applied { border-left: 4px solid #666; background: #f5f5f5; }
.meta-row.has-error { border-left: 4px solid #dc3232; background: #fff5f5; }

.meta-header { display: flex; align-items: center; gap: 15px; margin-bottom: 15px; }
.post-selection input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }
.post-info { flex: 1; }
.post-info h4 { margin: 0 0 8px 0; color: #0073aa; font-size: 16px; }
.post-info a { text-decoration: none; color: inherit; transition: color 0.2s ease; }
.post-info a:hover { color: #005a87; text-decoration: underline; }

.post-meta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.post-type-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    color: white;
}

.type-post { background: #e74c3c; }
.type-page { background: #3498db; }
.type-product { background: #f39c12; }
.type-proyecto { background: #9b59b6; }

.post-status { color: #666; font-size: 13px; }
.post-categories { color: #666; font-size: 12px; }

/* ========================================
   META DISPLAY CON CONTADOR
   ======================================== */
.meta-current {
    background: #fafafa;
    padding: 18px;
    border-radius: 6px;
    margin-bottom: 15px;
    border: 1px solid #e5e5e5;
}

.current-meta-display p { margin: 10px 0; font-size: 14px; }
.current-meta-display strong { color: #333; font-weight: 600; }

.char-counter {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.char-counter.good { background: #d4edda; color: #155724; }
.char-counter.warning { background: #fff3cd; color: #856404; }
.char-counter.error { background: #f8d7da; color: #721c24; }

.meta-value { font-style: italic; display: inline; }
.meta-value.missing { color: #dc3232; font-style: normal; }

/* ========================================
   META GENERATED (CON IA)
   ======================================== */
.meta-generated {
    background: #f0f8ff;
    padding: 18px;
    border-radius: 6px;
    border-left: 4px solid #00a651;
    border: 1px solid #c3e6cb;
}

.meta-field { margin-bottom: 15px; }
.meta-field label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
}

.meta-field textarea,
.meta-field input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.meta-field textarea:focus,
.meta-field input[type="text"]:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

/* ========================================
   ERROR DISPLAY
   ======================================== */
.meta-error {
    background: #fff5f5;
    border: 1px solid #f8d7da;
    border-left: 4px solid #dc3232;
    border-radius: 6px;
    padding: 15px;
    margin-top: 15px;
}

.error-message {
    color: #721c24;
    font-size: 14px;
    font-weight: 500;
}

.error-summary {
    background: #fff5f5;
    border: 1px solid #f8d7da;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 30px;
    text-align: left;
}

.error-summary ul {
    margin: 10px 0 0 20px;
    padding: 0;
}

.error-summary li {
    color: #721c24;
    font-size: 13px;
    margin: 5px 0;
}

/* ========================================
   NO RESULTS
   ======================================== */
.no-results {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #ddd;
}

.no-results p {
    font-size: 18px;
    color: #666;
    margin: 0;
}

/* ========================================
   POSTS HEADER & CONTROLS
   ======================================== */
.posts-header {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #0073aa;
}

.posts-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 15px 0;
    gap: 20px;
    flex-wrap: wrap;
}

.selection-controls { display: flex; align-items: center; gap: 20px; }

.selected-counter {
    background: #0073aa;
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
}

/* ========================================
   KEYWORDS
   ======================================== */
.keywords-container { margin-top: 10px; }
.keywords-list { display: flex; flex-wrap: wrap; gap: 8px; }
.keyword-tag {
    background: #0073aa;
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
}

/* ========================================
   ACTION BUTTONS
   ======================================== */
.action-buttons { display: flex; gap: 10px; margin-top: 15px; flex-wrap: wrap; }
.action-buttons button { flex: 1; min-width: 140px; }

/* ========================================
   CONFIRMATION
   ======================================== */
.confirmation-applied {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #00a651;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    animation: fadeInScale 0.4s ease;
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

/* ========================================
   PAGINATION
   ======================================== */
.pagination-container {
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.pagination-btn { margin: 0 5px; min-width: 40px; }
.pagination-btn.current-page {
    background: #0073aa !important;
    color: white !important;
    border-color: #0073aa !important;
}

/* ========================================
   NOTIFICATIONS
   ======================================== */
#notification-area {
    position: fixed;
    top: 32px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
}

.notification {
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideInRight 0.3s ease;
    font-weight: 500;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}

.notification.success { background: #00a651; color: white; }
.notification.error { background: #dc3232; color: white; }
.notification.warning { background: #ff6b35; color: white; }

/* ========================================
   BOTÓN FLOTANTE GENERAR
   ======================================== */
#generate-selected-floating {
    position: fixed !important;
    bottom: 30px !important;
    right: 30px !important;
    z-index: 9998 !important;
    background: linear-gradient(135deg, #00a651 0%, #00d66a 100%);
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 166, 81, 0.4);
    padding: 0;
    border: none;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#generate-selected-floating:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 166, 81, 0.5);
}

.floating-generate-content { display: flex; align-items: center; gap: 15px; padding: 16px 28px; }

.floating-generate-counter {
    color: white;
    font-size: 14px;
    font-weight: 700;
    padding-right: 15px;
    border-right: 2px solid rgba(255,255,255,0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.floating-generate-btn-text { color: white; font-weight: 700; font-size: 15px; white-space: nowrap; }

/* ========================================
   BOTÓN FLOTANTE APLICAR
   ======================================== */
#floating-apply-all {
    position: fixed !important;
    bottom: 100px !important;
    right: 30px !important;
    z-index: 9997 !important;
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 115, 170, 0.4);
    padding: 0;
    border: none;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: none;
}

#floating-apply-all:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 40px rgba(0, 115, 170, 0.5);
}

.floating-content { display: flex; align-items: center; gap: 15px; padding: 15px 25px; }

#floating-counter {
    color: white;
    font-size: 14px;
    font-weight: 600;
    padding-right: 15px;
    border-right: 1px solid rgba(255,255,255,0.3);
}

#floating-apply-btn {
    background: white;
    color: #0073aa;
    border: none;
    border-radius: 30px;
    padding: 10px 25px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

#floating-apply-btn:hover { background: #f0f0f0; transform: scale(1.05); }

/* ========================================
   MODAL DE PROGRESO AI
   ======================================== */
#ai-generation-status:empty { display: none !important; }

#ai-generation-status:not(:empty) {
    display: flex !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    animation: fadeInBackdrop 0.3s ease;
}

@keyframes fadeInBackdrop { from { opacity: 0; } to { opacity: 1; } }

.ai-progress-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    max-width: 550px;
    width: 90%;
    padding: 0 0 30px 0;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.ai-progress-container h3 {
    margin: 0;
    padding: 30px 30px 20px;
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: white;
    text-align: center;
    border-radius: 20px 20px 0 0;
}

.ai-progress-container h3::before {
    content: '🤖';
    display: block;
    font-size: 40px;
    margin-bottom: 10px;
    animation: bounce 2s infinite;
}

@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.progress-bar {
    background: #e8ecef;
    border-radius: 50px;
    height: 12px;
    overflow: hidden;
    position: relative;
    margin: 25px 30px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-fill {
    background: linear-gradient(90deg, #00a651 0%, #00d66a 50%, #00a651 100%);
    height: 100%;
    border-radius: 50px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    background-size: 200% 100%;
    animation: progressFlow 2s linear infinite;
    box-shadow: 0 0 10px rgba(0, 166, 81, 0.3);
}

@keyframes progressFlow { 0% { background-position: 0% 0; } 100% { background-position: 200% 0; } }

.progress-text { text-align: center; color: #2d3748; font-size: 18px; font-weight: 600; margin: 20px 30px 10px; }

.progress-details {
    text-align: center;
    font-size: 15px;
    margin: 15px 30px;
    padding: 15px;
    background: #f7fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.ai-complete {
    background: white;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    max-width: 550px;
    width: 90%;
    padding: 0 0 35px 0;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    text-align: center;
}

.ai-complete h3 {
    margin: 0;
    padding: 30px 30px 20px;
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #00a651 0%, #00d66a 100%);
    color: white;
    text-align: center;
    border-radius: 20px 20px 0 0;
}

.ai-complete h3::before { content: '🎉'; display: block; font-size: 40px; margin-bottom: 10px; }

.ai-complete p {
    font-size: 17px;
    color: #4a5568;
    margin: 25px 30px;
    padding: 20px;
    background: #f0fdf4;
    border-radius: 12px;
    border: 2px solid #86efac;
}

#close-ai-status {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 50px !important;
    padding: 14px 40px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(0, 115, 170, 0.3) !important;
    margin-top: 10px;
}

#close-ai-status:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(0, 115, 170, 0.4) !important;
}

/* ========================================
   ANIMACIONES
   ======================================== */
.meta-row.just-generated {
    animation: generateSuccess 2.5s ease;
}

@keyframes generateSuccess {
    0% { background: #fff; transform: scale(1); border-left: 1px solid #ddd; }
    30% { background: #e8f5e8; transform: scale(1.03); border-left: 4px solid #00a651; box-shadow: 0 8px 25px rgba(0, 166, 81, 0.25); }
    60% { background: #e8f5e8; box-shadow: 0 0 0 4px rgba(0, 166, 81, 0.15), 0 8px 25px rgba(0, 166, 81, 0.15); }
    100% { background: #f0f8f0; box-shadow: 0 2px 5px rgba(0,0,0,0.05); transform: scale(1); border-left: 4px solid #00a651; }
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .workflow-steps { grid-template-columns: 1fr; }
    .card { padding: 25px 20px; }
    .filters-grid { grid-template-columns: 1fr 1fr; }
    
    #generate-selected-floating, #floating-apply-all { right: 15px !important; max-width: 280px; }
    #floating-apply-all { bottom: 80px !important; }
    #generate-selected-floating { bottom: 15px !important; }
    
    .floating-generate-content, .floating-content { padding: 12px 18px; gap: 10px; }
    .floating-generate-counter, #floating-counter { font-size: 12px; padding-right: 10px; }
    
    .ai-progress-container, .ai-complete { width: 95%; max-width: 95%; }
    .ai-progress-container h3, .ai-complete h3 { font-size: 20px; padding: 25px 20px 15px; }
    .progress-text { font-size: 16px; }
    .progress-details { font-size: 14px; }
}

@media (max-width: 480px) {
    .filters-grid { grid-template-columns: 1fr; }
    .filter-actions { flex-direction: column; align-items: flex-start; }
}