/* FlowDino Admin Styles */

/* Titre principal FlowDino avec logo */
.wrap h1 {
    color: #2563eb !important;
    font-weight: 600;
    margin-bottom: 16px;
}

.flowdino-title-with-logo {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
}

.flowdino-title-with-logo img {
    height: 32px !important;
    width: 32px !important;
    vertical-align: middle;
}

.flowdino-title-with-logo span {
    margin: 0;
}

.flowdino-stats {
    margin: 20px 0;
}

.flowdino-stats table {
    max-width: 500px;
}

.flowdino-status {
    font-weight: bold;
}

/* Styles modernes pour les onglets */
.nav-tab-wrapper {
    margin-bottom: 0;
    border: none;
    padding: 0;
    background: none;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.nav-tab-wrapper .nav-tab {
    background: white;
    border: 1px solid #d1d5db;
    color: #374151;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    margin: 0;
    position: relative;
    white-space: nowrap;
}

.nav-tab-wrapper .nav-tab:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #111827;
    text-decoration: none;
}

.nav-tab-wrapper .nav-tab.nav-tab-active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
    font-weight: 600;
}

.nav-tab-wrapper .nav-tab.nav-tab-active:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.tab-content {
    background: #fff;
    padding: 20px;
    border: 1px solid #ccd0d4;
    border-top: 1px solid #ccd0d4;
    margin-top: 0;
}

.flowdino-tab-content {
    background: #fff;
    padding: 20px;
}

.flowdino-tab-content h2 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #ccd0d4;
}

.help-section {
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border-left: 4px solid #0073aa;
}

.help-section h3 {
    margin-top: 0;
    color: #0073aa;
}

.help-section ul, .help-section ol {
    margin-left: 20px;
}

/* Animation pour les icônes de chargement */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Select2 customization */
.flowdino-category-select {
    width: 100% !important;
    max-width: 500px !important;
}

.select2-container {
    width: 100% !important;
    max-width: 500px !important;
}

.select2-container--default .select2-selection--single {
    height: 31px !important;
    border: 1px solid #ddd !important;
    border-radius: 3px !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 29px !important;
    padding-left: 8px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 29px !important;
}

.select2-results__options {
    max-height: 400px !important;
    overflow-y: auto !important;
}

.select2-search__field {
    width: 100% !important;
}

/* Category hierarchy styling */
.category-hierarchy-item {
    padding-left: 20px;
}

.category-hierarchy-item .category-count {
    color: #666;
    font-size: 0.9em;
    font-style: italic;
}

/* Override WordPress card max-width so all tabs use full width */
.flowdino-tab-content .card {
    max-width: 100% !important;
    box-sizing: border-box;
}

.table-responsive {
    overflow-x: auto;
    margin: 20px 0;
}

/* Categories tab specific styles */
.flowdino-categories-table {
    margin: 20px 0;
}

.flowdino-categories-table th {
    background-color: #f9f9f9;
    font-weight: bold;
}

.flowdino-categories-table td {
    vertical-align: middle;
    padding: 12px 8px;
}

.form-table th {
    width: 200px;
}

.sync-product {
    margin-right: 5px;
}

.flowdino-connection-status {
    margin: 15px 0;
    padding: 10px 15px;
    border-radius: 4px;
}

.flowdino-connection-status.connected {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.flowdino-connection-status.disconnected {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.flowdino-progress {
    background-color: #f1f1f1;
    border-radius: 4px;
    padding: 3px;
    margin: 10px 0;
}

.flowdino-progress-bar {
    background-color: #007cba;
    height: 20px;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.flowdino-sync-results {
    margin-top: 20px;
}

.flowdino-sync-results .notice {
    margin: 5px 0;
}

.attribute-mapping {
    margin: 20px 0;
}

.attribute-mapping h4 {
    margin-bottom: 10px;
    color: #23282d;
}

.mapping-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
}

.mapping-row label {
    flex: 1;
    margin-right: 15px;
    font-weight: 600;
}

.mapping-row select {
    flex: 2;
}

.sync-actions {
    margin: 20px 0;
}

.sync-actions .button {
    margin-right: 10px;
}

.flowdino-logo {
    max-width: 200px;
    margin-bottom: 20px;
}

/* Styles supprimés - remplacés par les nouveaux styles d'onglets modernes */

/* Responsive design pour les onglets */
@media (max-width: 768px) {
    .nav-tab-wrapper {
        gap: 6px;
    }
    
    .nav-tab-wrapper .nav-tab {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .flowdino-title-with-logo {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 8px !important;
    }
    
    .flowdino-title-with-logo img {
        height: 28px !important;
        width: 28px !important;
    }
    
    .mapping-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .mapping-row label {
        margin-right: 0;
        margin-bottom: 5px;
    }
    
    .flowdino-stats table {
        font-size: 14px;
    }
}
/* ============================================================
   Sales tab
   ============================================================ */

.flowdino-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 20px 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.flowdino-sales-tab #flowdino-sync-sales {
    background: #00acc1;
    border-color: #0097a7;
    color: #fff;
    font-weight: 600;
    padding: 10px 20px;
    height: auto;
    font-size: 13px;
}

.flowdino-sales-tab #flowdino-sync-sales:hover {
    background: #0097a7;
    border-color: #00838f;
}

@keyframes spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.flowdino-sales-tab .dashicons.spinning {
    animation: spin 1s linear infinite;
}

/* ============================================================
   Select2 / SelectWoo – shared tab styles
   ============================================================ */
.select2-container--default .select2-selection--single {
    height: 32px;
    line-height: 30px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    padding-left: 12px;
    padding-right: 20px;
    line-height: 30px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 30px;
    right: 6px;
}
.select2-dropdown {
    border: 1px solid #8c8f94;
    border-radius: 4px;
}
.select2-search--dropdown .select2-search__field {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 6px;
}
.select2-container,
.selectWoo-container {
    width: 100% !important;
    max-width: 500px !important;
}
.select2-selection,
.selectWoo-selection {
    height: 31px !important;
    border: 1px solid #ddd !important;
}
.select2-results__options,
.selectWoo-results__options {
    max-height: 400px;
    overflow-y: auto;
}
.select2-search__field,
.selectWoo-search__field {
    width: 100% !important;
}
@media (max-width: 768px) {
    .flowdino-category-select {
        max-width: 100% !important;
    }
    .select2-container,
    .selectWoo-container {
        max-width: 100% !important;
    }
    .wp-list-table th,
    .wp-list-table td {
        padding: 8px 4px;
        font-size: 0.9em;
    }
}

/* ============================================================
   Brands tab
   ============================================================ */
.flowdino-brand-select,
.flowdino-default-brand-select {
    width: 100% !important;
    max-width: 500px !important;
}
.flowdino-brand-search-container {
    position: relative;
}
.flowdino-brand-search {
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 8px 12px;
}
.flowdino-brand-search:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 2px rgba(0, 115, 170, 0.5);
}
.flowdino-brand-results {
    border-radius: 3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.flowdino-brand-result-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}
.flowdino-brand-result-item:hover {
    background-color: #f5f5f5;
}
.flowdino-brand-result-item:last-child {
    border-bottom: none;
}
.flowdino-brand-result-name {
    font-weight: 500;
    color: #333;
}
.flowdino-brand-result-description {
    font-size: 0.85em;
    color: #666;
    margin-top: 2px;
    font-style: italic;
}
.flowdino-brand-clear {
    background: none;
    border: none;
    color: #dc3232;
    cursor: pointer;
    font-size: 0.8em;
}
.flowdino-brand-clear:hover {
    color: #a00;
}
.flowdino-brand-loading {
    padding: 10px 12px;
    text-align: center;
    color: #666;
    font-style: italic;
}
.flowdino-brand-no-results {
    padding: 10px 12px;
    text-align: center;
    color: #999;
    font-style: italic;
}
.card {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}
@media (max-width: 768px) {
    .flowdino-brand-search-container {
        max-width: 100% !important;
    }
}

/* ============================================================
   Help tab
   ============================================================ */
.flowdino-help-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
}
.flowdino-help-section h3 {
    margin-top: 0;
    color: #23282d;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
    margin-bottom: 20px;
}
.flowdino-help-section ul {
    margin: 10px 0;
}
.flowdino-help-section li {
    margin-bottom: 8px;
    line-height: 1.5;
}
.flowdino-important-notes {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 5px;
    padding: 15px;
    margin: 15px 0;
}
.flowdino-important-notes ul {
    margin: 0;
    padding-left: 20px;
}
.flowdino-important-notes li {
    color: #856404;
    margin-bottom: 10px;
    font-size: 14px;
}
.flowdino-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    margin: 15px 0;
}
.feature-item {
    background: #f9f9f9;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
}
.feature-item h4 {
    margin: 0 0 10px 0;
    color: #23282d;
}
.feature-item p {
    margin: 0;
    color: #666;
    font-size: 0.95em;
}
.flowdino-troubleshooting {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 20px;
    margin: 15px 0;
}
.trouble-item {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}
.trouble-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}
.trouble-item h5 {
    color: #d63638;
    margin: 0 0 10px 0;
}
.trouble-item ul {
    margin: 0;
    padding-left: 20px;
}
.trouble-item li {
    margin-bottom: 5px;
    color: #666;
}
.flowdino-support-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 15px 0;
}
.support-item {
    background: #f0f8ff;
    padding: 20px;
    border: 1px solid #b3d9ff;
    border-radius: 5px;
}
.support-item h4 {
    margin: 0 0 10px 0;
    color: #0073aa;
}
.support-item ul {
    margin: 10px 0 0 0;
    padding-left: 20px;
}
.support-item li {
    margin-bottom: 5px;
    color: #666;
}
.flowdino-tab-content ol {
    margin-left: 20px;
}
.flowdino-tab-content ol li {
    margin-bottom: 15px;
}
.flowdino-tab-content ol li p {
    margin: 5px 0;
    color: #666;
}

/* ============================================================
   Products tab – table row interaction styles
   ============================================================ */
.flowdino-edit-product-btn:hover .dashicons {
    transform: scale(1.1);
}
.flowdino-edit-product-btn:focus {
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.3);
    outline: none;
}
.wp-list-table td {
    vertical-align: middle;
}
.wp-list-table .check-column,
.wp-list-table td:last-child {
    text-align: center;
}
.wp-list-table tbody tr {
    transition: all 0.2s ease;
    user-select: none;
}
.wp-list-table tbody tr:hover {
    background-color: #f8f9fa !important;
}
.wp-list-table tbody tr.selected {
    background-color: #e3f2fd !important;
    border-left: 3px solid #2563eb !important;
}

/* ============================================================
   Animation keyframes
   ============================================================ */
@keyframes flowdinoFadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes flowdinoFadeOut {
    from { opacity: 1; transform: scale(1); }
    to   { opacity: 0; transform: scale(0.9); }
}
@keyframes flowdinoSlideIn {
    from { opacity: 0; transform: translateX(100%); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes flowdinoSlideOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(100%); }
}