/* Products Module CSS - Integrated with Audienix design system */

/* Button Styles - Using global styles from main.css */

/* ===== FILTROS MINIMALISTAS ===== */
.filters-container {
    margin-bottom: 24px;
    padding: 0 32px;
    background: none;
    border: none;
    box-shadow: none;
    border-radius: 0;
    width: 100%;
}

.filters-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: none;
    border: none;
    padding: 0;
    box-shadow: none;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
    background: none;
    border: none;
    padding: 0;
    box-shadow: none;
}

.category-tabs {
    display: flex;
    gap: 0;
    background: none;
    border: none;
    padding: 0;
    box-shadow: none;
}

.category-tab {
    background: none;
    border: none;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.category-tab:first-child {
    padding-left: 0;
}

.category-tab:hover {
    color: #374151;
}

.category-tab.active {
    color: #1f2937;
}

.category-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #1f2937;
    border-radius: 1px;
}

.category-tab:first-child.active::after {
    left: 0;
    right: 0;
}

/* ===== BULK ACTIONS IN FILTERS ROW ===== */
.bulk-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ===== PRODUCT SELECTION ===== */
.product-select {
    display: flex;
    align-items: center;
}

.product-checkbox {
    display: none;
}

.checkbox-label {
    display: block;
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.checkbox-label:hover {
    border-color: #9ca3af;
    background: #f9fafb;
}

.product-checkbox:checked + .checkbox-label {
    background: #3b82f6;
    border-color: #3b82f6;
}

.product-checkbox:checked + .checkbox-label::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5px;
    width: 5px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* ===== HEADER STYLES - Exact Copy from Media Center ===== */
.header {
    background: none;
    padding: 0 32px;
    margin-bottom: 32px; /* Aumentado para mejor separación */
    border: none;
    box-shadow: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid #e5e7eb;
}

.header-info h2 {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.025em;
}

.header-info p {
    font-size: 13px;
    color: #6b7280;
    margin: 4px 0 0 0;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Status Indicator Styles */
.status-connected,
.status-disconnected {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
    margin-top: 8px;
}

.status-connected {
    background: #dcfce7;
    color: #166534;
}

.status-disconnected {
    background: #fef2f2;
    color: #dc2626;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: #ffffff;
    border: 1px solid #e5e5e0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    transition: all 0.2s ease;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.stat-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    background: #f5f5f5;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a1a1a;
    flex-shrink: 0;
}

.stat-details {
    flex: 1;
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: #888;
    font-weight: 500;
}

/* Products Section */
.products-section {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0 16px;
    box-shadow: none;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

/* Product Card */
.product-card {
    background: #ffffff;
    border: 1px solid #e5e5e0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    transition: all 0.2s ease;
    position: relative;
}

.product-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
    border-color: #d0d0d0;
}

/* Product Header */
.product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.product-title h3 {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.product-type {
    display: inline-block;
    background: #f5f5f5;
    color: #666;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

/* Product Menu */
.product-menu {
    position: relative;
}

.menu-btn {
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.menu-btn:hover {
    background: #f5f5f5;
    color: #1a1a1a;
}

.product-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #ffffff;
    border: 1px solid #e5e5e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 140px;
    z-index: 100;
    display: none;
    overflow: hidden;
}

.product-menu-dropdown.show {
    display: block;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    font-size: 14px;
    color: #1a1a1a;
    text-decoration: none;
    border: none;
    background: transparent;
    width: 100%;
    cursor: pointer;
    transition: background 0.2s ease;
    font-family: inherit;
}

.menu-item:hover {
    background: #f5f5f5;
    text-decoration: none;
    color: #1a1a1a;
}

.menu-item.delete {
    color: #dc3545;
}

.menu-item.delete:hover {
    background: #fff5f5;
    color: #dc3545;
}

/* Product Info */
.product-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 13px;
    color: #888;
}

.product-category {
    display: flex;
    align-items: center;
    gap: 6px;
}

.product-date {
    font-size: 12px;
}

/* Product Actions */
.product-actions {
    display: flex;
    gap: 8px;
}

/* Button sizes and variants - Using global styles from main.css */

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.empty-icon {
    margin-bottom: 20px;
    color: #ccc;
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: #888;
    margin-bottom: 24px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    color: #1a1a1a;
}

.loading-content p {
    margin-top: 16px;
    font-size: 14px;
    color: #666;
}

/* Form Styles (for reuse in form.html) */
.form-container {
    max-width: 800px;
    margin: 0 auto;
}

.form-card {
    background: #ffffff;
    border: 1px solid #e5e5e0;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.form-section {
    margin-bottom: 32px;
}

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

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e5e0;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #1a1a1a;
    margin-bottom: 6px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e5e5e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #ffffff;
    transition: border-color 0.2s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: #1a1a1a;
    box-shadow: 0 0 0 3px rgba(26,26,26,0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-help {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 24px;
    border-top: 1px solid #e5e5e0;
}

/* AI Assistant Styles (for hybrid form) */
.ai-assistant-panel {
    background: #f8f9fa;
    border: 1px solid #e5e5e0;
    border-radius: 12px;
    padding: 20px;
    margin-top: 24px;
}

.ai-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.ai-icon {
    background: #1a1a1a;
    color: white;
    padding: 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.ai-suggestion {
    background: white;
    border: 1px solid #e5e5e0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.ai-suggestion-text {
    font-size: 14px;
    color: #374151;
    line-height: 1.5;
    margin-bottom: 12px;
}

.ai-suggestion-actions {
    display: flex;
    gap: 8px;
}

.btn-ai-apply {
    background: #1a1a1a;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-ai-apply:hover {
    background: #333;
}

.btn-ai-regenerate {
    background: transparent;
    color: #666;
    border: 1px solid #e5e5e0;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-ai-regenerate:hover {
    background: #f5f5f5;
    color: #1a1a1a;
}

/* Responsive Design */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .product-actions {
        flex-direction: column;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-card {
        padding: 20px;
    }
    
    .main-content {
        padding: 20px;
    }
}

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

    .stat-content {
        gap: 12px;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
    }

    .stat-number {
        font-size: 20px;
    }

    .product-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .products-section {
        padding: 16px;
    }
}

/* ===== CUSTOM CONFIRM MODAL ===== */
.confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirm-modal__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.confirm-modal__container {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
    animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.confirm-modal__icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    background: #fef2f2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #dc3545;
}

.confirm-modal__title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 8px 0;
}

.confirm-modal__message {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 24px 0;
    line-height: 1.5;
}

.confirm-modal__actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-modal__actions .btn {
    min-width: 100px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.confirm-modal__actions .btn--secondary {
    background: #f5f5f5;
    color: #1a1a1a;
    border: 1px solid #e5e5e0;
}

.confirm-modal__actions .btn--secondary:hover {
    background: #e8e8e8;
    border-color: #d0d0d0;
}

.confirm-modal__actions .btn--danger {
    background: #dc3545;
    color: white;
    border: none;
}

.confirm-modal__actions .btn--danger:hover {
    background: #c82333;
}

/* Modal responsive */
@media (max-width: 480px) {
    .confirm-modal__container {
        padding: 24px;
        margin: 16px;
    }

    .confirm-modal__actions {
        flex-direction: column-reverse;
    }

    .confirm-modal__actions .btn {
        width: 100%;
    }
}