/**
* ChatGPT Feed Module - Modern Backend CSS
* Clean, minimal design with modern color palette
*/

/* ============================================
   MODERN COLOR PALETTE
   ============================================ */
:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --success: #10b981;
    --success-hover: #059669;
    --warning: #f59e0b;
    --warning-hover: #d97706;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --neutral: #6b7280;
    --neutral-hover: #4b5563;
    --bg-gray: #f9fafb;
    --border-gray: #e5e7eb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
}

/* ============================================
   MODERN PANELS
   ============================================ */
.modern-panel {
    background: white;
    border: 1px solid var(--border-gray);
    border-radius: 8px;
    box-shadow: none;
    margin-bottom: 20px;
}

.panel {
    background: white !important;
    border: 1px solid var(--border-gray) !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    margin-bottom: 20px;
}

.panel-heading {
    background: white !important;
    border-bottom: 1px solid var(--border-gray) !important;
    border-radius: 8px 8px 0 0 !important;
    padding: 16px 20px !important;
    font-weight: 600 !important;
    color: var(--text-primary) !important;
}

.panel-body {
    padding: 20px;
}

/* Override PrestaShop default h3 styles */
#content.bootstrap h3:not(.modal-title) {
    background: transparent !important;
    border-bottom: none !important;
    padding: 0 !important;
    margin: 0 0 16px 0 !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    color: var(--text-primary) !important;
}

/* ============================================
   MODERN BUTTONS
   ============================================ */
.btn-modern {
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: none;
    cursor: pointer;
}

.btn-modern-primary {
    background: var(--primary);
    color: white;
}

.btn-modern-primary:hover {
    background: var(--primary-hover);
    color: white;
    transform: translateY(-1px);
}

.btn-modern-success {
    background: var(--success);
    color: white;
}

.btn-modern-success:hover {
    background: var(--success-hover);
    color: white;
}

.btn-modern-warning {
    background: var(--warning);
    color: white;
}

.btn-modern-warning:hover {
    background: var(--warning-hover);
    color: white;
}

.btn-modern-danger {
    background: var(--danger);
    color: white;
}

.btn-modern-danger:hover {
    background: var(--danger-hover);
    color: white;
}

.btn-modern-secondary {
    background: var(--bg-gray);
    color: var(--text-primary);
    border: 1px solid var(--border-gray);
}

.btn-modern-secondary:hover {
    background: #e5e7eb;
    color: var(--text-primary);
}

/* Panel heading buttons */
#content.bootstrap .panel-heading .panel-heading-action > a.btn {
    position: relative !important;
}

.panel-heading .btn {
    background: var(--primary) !important;
    color: white !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 8px 16px !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
}

.panel-heading .btn:hover {
    background: var(--primary-hover) !important;
    color: white !important;
    transform: translateY(-1px);
}

.panel-heading .btn-default {
    background: var(--bg-gray) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-gray) !important;
}

.panel-heading .btn-default:hover {
    background: #e5e7eb !important;
    color: var(--text-primary) !important;
}

/* Override default PrestaShop buttons */
.btn-primary {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    box-shadow: none !important;
}

.btn-primary:hover {
    background: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
}

.btn-success {
    background: var(--success) !important;
    border-color: var(--success) !important;
}

.btn-default {
    background: white !important;
    border: 1px solid var(--border-gray) !important;
    color: var(--text-primary) !important;
}

.btn-default:hover {
    background: #e5e7eb !important;
    color: var(--text-primary) !important;
}

/* ============================================
   MODERN STATISTICS CARDS
   ============================================ */
.stats-card {
    background: white;
    border: 1px solid var(--border-gray);
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    transition: all 0.2s ease;
}

.stats-card:hover {
    border-color: var(--primary);
    background: white;
    transform: translateY(-2px);
}

.stats-card i {
    font-size: 40px;
    margin-bottom: 12px;
    display: block;
}

.stats-card h3 {
    font-size: 28px;
    font-weight: 700;
    margin: 8px 0;
    color: var(--text-primary);
}

.stats-card p {
    margin: 0;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
}

/* Add spacing after stats row */
.row:has(.stats-card) {
    margin-bottom: 20px;
}

/* ============================================
   MODE SWITCHER
   ============================================ */
.mode-switcher {
    background: white;
    border: 1px solid var(--border-gray);
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    margin-bottom: 24px;
}

.mode-btn {
    display: inline-block;
    padding: 20px 40px;
    min-width: 200px;
    border-radius: 8px;
    border: 2px solid #2563eb;
    background: white;
    color: #2563eb;
    text-decoration: none;
    transition: all 0.2s ease;
    margin: 0 8px;
}

.mode-btn:hover {
    border-color: #1d4ed8;
    background: #eff6ff;
    text-decoration: none !important;
    color: #1d4ed8;
}

.mode-btn.active {
    border-color: #2563eb;
    background: #2563eb;
    color: white !important;
}

.mode-btn.active:hover {
    border-color: #1d4ed8;
    background: #1d4ed8;
    color: white !important;
    text-decoration: none !important;
}

.mode-btn i {
    font-size: 32px;
    display: block;
    margin-bottom: 8px;
    color: inherit;
}

.mode-btn strong {
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
    color: inherit;
}

.mode-btn small {
    display: block;
    font-size: 12px;
    opacity: 0.9;
    color: inherit;
}

/* Ensure active mode has white text for all elements */
.mode-btn.active i,
.mode-btn.active strong,
.mode-btn.active small {
    color: white !important;
}

/* Ensure inactive mode has blue text for all elements */
.mode-btn:not(.active) i,
.mode-btn:not(.active) strong,
.mode-btn:not(.active) small {
    color: #2563eb !important;
}

.mode-btn:not(.active):hover i,
.mode-btn:not(.active):hover strong,
.mode-btn:not(.active):hover small {
    color: #1d4ed8 !important;
}

/* ============================================
   TABLES
   ============================================ */
.table {
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    background: var(--bg-gray);
    border-bottom: 1px solid var(--border-gray);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
}

.table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-gray);
    color: var(--text-primary);
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(249, 250, 251, 0.5);
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    border-radius: 8px;
    border: 1px solid;
    padding: 16px 20px;
}

.alert-info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

.alert-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.alert-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.alert-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

/* ============================================
   FORMS
   ============================================ */
.form-control {
    border: 1px solid var(--border-gray);
    border-radius: 6px;
    padding: 8px 12px;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

.help-block {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 6px;
}

/* ============================================
   TABS
   ============================================ */
.nav-tabs {
    border-bottom: 1px solid var(--border-gray);
    margin-bottom: 0;
}

.nav-tabs > li > a {
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    padding: 12px 20px;
    margin-bottom: -1px;
    transition: all 0.2s ease;
}

.nav-tabs > li > a:hover {
    background: transparent;
    border-bottom-color: var(--border-gray);
    color: var(--text-primary);
}

.nav-tabs > li.active > a {
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--primary);
    color: var(--primary);
    font-weight: 600;
}

.tab-content {
    background: white;
    border: 1px solid var(--border-gray);
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 24px;
}

/* ============================================
   WELCOME SECTION
   ============================================ */
.welcome-section {
    background: white;
    border: 1px solid var(--border-gray);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
}

.welcome-section h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.welcome-section p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
    line-height: 1.6;
}

/* ============================================
   FORM FOOTER
   ============================================ */
.panel-footer {
    background: white !important;
    border-top: 1px solid var(--border-gray) !important;
    padding: 16px 20px !important;
}

.panel-footer .btn {
    position: relative !important;
}

/* ============================================
   UTILITIES
   ============================================ */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mt-3 {
    margin-top: 16px !important;
}

.mb-3 {
    margin-bottom: 16px !important;
}

/* ============================================
   THREE-PANEL SELECTORS
   ============================================ */
.category-item,
.manufacturer-item,
.condition-item,
.attribute-item {
    padding: 8px 12px !important;
    cursor: pointer;
    border-bottom: 1px solid var(--border-gray);
    transition: all 0.2s ease;
    user-select: none;
}

.category-item:hover,
.manufacturer-item:hover,
.condition-item:hover,
.attribute-item:hover {
    background: var(--bg-gray) !important;
}

.category-item.selected,
.manufacturer-item.selected,
.condition-item.selected,
.attribute-item.selected {
    background: #eff6ff !important;
}

.category-item i,
.manufacturer-item i,
.condition-item i,
.attribute-item i {
    margin-right: 8px;
    color: var(--text-secondary);
}

/* Panel styling for selectors */
.form-group .panel {
    margin-bottom: 0 !important;
}

.form-group .panel-heading {
    font-size: 13px !important;
    padding: 10px 12px !important;
    background: var(--bg-gray) !important;
    font-weight: 600 !important;
}

.form-group .panel-body {
    padding: 0 !important;
}

/* ============================================
   ACTION BUTTONS
   ============================================ */
.btn-group-action {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}

.btn-group-action .btn {
    padding: 6px 10px !important;
    min-width: auto !important;
}

.btn-group-action .btn i {
    margin: 0 !important;
}

.btn-group-action .btn:hover i {
    color: inherit !important;
}

/* ============================================
   TABLE IMPROVEMENTS
   ============================================ */
.table thead th {
    background: var(--bg-gray) !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    color: var(--text-secondary) !important;
}

.table tbody td {
    vertical-align: middle !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .mode-btn {
        display: block;
        margin: 8px 0;
        width: 100%;
    }
    
    .stats-card {
        margin-bottom: 16px;
    }
    
    .btn-group-action {
        flex-wrap: wrap;
    }
}
