.channel-manager-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

@media (min-width: 1200px) {
    .channel-manager-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.channel-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    height: 100%;
    min-height: 250px;
    display: flex;
    flex-direction: column;
}

.channel-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.channel-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.channel-logo {
    width: 40px;
    height: 40px;
    margin-right: 15px;
    border-radius: 8px;
    object-fit: cover;
}

.channel-name {
    font-size: 1.2em;
    font-weight: 600;
    color: #383838;
}

.channel-status {
    margin-left: auto;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.9em;
}

.status-connected {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-disconnected {
    background: #f5f5f5;
    color: #757575;
}

.channel-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.channel-description {
    color: #666;
    font-size: 0.95em;
    line-height: 1.5;
    margin-bottom: 15px;
    flex-grow: 1;
}

.channel-actions {
    margin-top: auto;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-disconnect {
    background-color: #E51E5B;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-disconnect:hover {
    background-color: #d41a51;
}

.api-form-container {
    margin-top: 25px;
    width: 100%;
}

.api-form {
    display: none;
    margin-top: 25px;
    width: 100%;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.api-form.active {
    display: block;
}

.api-form input {
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-size: 0.9em;
    font-weight: 500;
}

.input-wrapper {
    position: relative;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 2px solid #eee;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.form-control:focus {
    border-color: #222;
    outline: none;
    box-shadow: 0 0 0 3px rgba(34,34,34,0.1);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.btn-cancel {
    padding: 8px 16px;
    border: 1px solid #ccc;
    background: #fff;
    color: #333;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel:hover {
    background: #f5f5f5;
}

.btn-confirm-disconnect {
    padding: 8px 16px;
    border: none;
    background: #E51E5B;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-confirm-disconnect:hover {
    background: #d41a51;
}

.btn-confirm-disconnect .btn-loader {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.btn-confirm-disconnect.loading .btn-text {
    display: none;
}

.btn-confirm-disconnect.loading .btn-loader {
    display: block;
}

.btn-connect,
.btn-disconnect,
.btn-toggle,
.btn-sync {
    padding: 10px 15px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-align: center;
    flex: 1;
    min-width: 130px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-sync i,
.btn-disconnect i {
    font-size: 12px;
}

.btn-connect:hover,
.btn-disconnect:hover,
.btn-toggle:hover,
.btn-sync:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-connect:active,
.btn-disconnect:active,
.btn-toggle:active,
.btn-sync:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.btn-connect {
    background: #222 !important;
    color: white !important;
}

.btn-connect:hover {
    background: #333;
    transform: translateY(-1px);
}

.btn-disconnect {
    background: #E51E5B;
    color: white;
}

.btn-disconnect:hover {
    background: #d41a51;
}

.btn-sync {
    background: #4CAF50;
    color: white;
}

.btn-sync:hover {
    background: #388E3C;
}

.btn-sync.loading,
.btn-disconnect.loading,
.btn-connect.loading {
    position: relative;
    color: transparent;
}

.btn-sync.loading:after,
.btn-disconnect.loading:after,
.btn-connect.loading:after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.sync-info {
    flex-basis: 100%;
    margin-top: 15px;
    font-size: 0.85em;
    color: #666;
    background: #f5f5f5;
    padding: 8px 12px;
    border-radius: 4px;
}

.channel-error {
    color: #f44336;
    font-size: 0.9em;
    margin-top: 10px;
    display: none;
}

.channel-success {
    color: #4caf50;
    font-size: 0.9em;
    margin-top: 10px;
    display: none;
}

.channel-manager-note {
    background-color: #f8f9fa;
    border-left: 4px solid #6c757d;
    padding: 15px;
    margin: 10px 0 20px;
    font-style: italic;
    color: #666;
}

.channel-manager-note i {
    margin-right: 8px;
    color: #6c757d;
}

/* Bouton d'aide flottant */
.floating-help-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #E51E5B;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 1000;
}

.floating-help-button:hover {
    background-color: #d41a51;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.floating-help-button i {
    font-size: 20px;
}

/* Modal de documentation */
.documentation-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    overflow-y: auto;
}

.documentation-content {
    position: relative;
    background-color: white;
    width: 90%;
    max-width: 800px;
    margin: 50px auto;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.documentation-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.documentation-header h2 {
    margin: 0;
    color: #333;
    font-size: 24px;
}

.close-documentation {
    background: none;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.close-documentation:hover {
    color: #333;
}

.documentation-body {
    padding: 30px;
    max-height: 70vh;
    overflow-y: auto;
}

.channel-doc {
    margin-bottom: 40px;
}

.channel-doc:last-child {
    margin-bottom: 0;
}

.channel-doc h3 {
    color: #E51E5B;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

.doc-section {
    margin-bottom: 25px;
}

.doc-section h4 {
    color: #444;
    margin-bottom: 15px;
}

.doc-section ol {
    padding-left: 20px;
    margin-bottom: 20px;
}

.doc-section li {
    margin-bottom: 10px;
    line-height: 1.5;
}

.doc-note {
    background-color: #f8f9fa;
    border-left: 4px solid #E51E5B;
    padding: 15px;
    margin-top: 20px;
}

.doc-note p {
    margin: 0;
    color: #666;
}

.doc-note strong {
    color: #333;
}

/* Style pour le body quand le modal est ouvert */
body.modal-open {
    overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
    .documentation-content {
        width: 95%;
        margin: 20px auto;
    }

    .documentation-header h2 {
        font-size: 20px;
    }

    .floating-help-button {
        bottom: 20px;
        right: 20px;
        padding: 10px 16px;
    }

    .floating-help-button i {
        font-size: 18px;
    }
}

/* Masquer le fil d'ariane sur la page channel manager */
body.page-template-user-dashboard-channel-manager .breadcrumb_container {
    display: none !important;
}

/* Animation pour le chargement */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading {
    position: relative;
    pointer-events: none;
}

.loading:after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2196f3;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Styles pour la popup */
.channel-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(3px);
}

.channel-popup.active {
    display: flex;
}

.popup-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
}

.channel-popup.active .popup-content {
    transform: translateY(0);
    opacity: 1;
}

.popup-header {
    padding: 15px;
    text-align: right;
}

.close-popup {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    width: 32px;
    height: 32px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-popup:hover {
    background: #f5f5f5;
    color: #333;
}

.popup-body {
    padding: 0 30px 30px;
    text-align: center;
}

.popup-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 15px;
    padding: 15px;
    background: #f8f8f8;
}

.popup-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.popup-body h3 {
    margin: 0 0 10px;
    font-size: 1.4em;
    color: #333;
}

.popup-description {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 25px;
}

.popup-body .btn-connect {
    width: 100%;
    padding: 12px;
    background: #222;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-body .btn-connect:hover {
    background: #333;
    transform: translateY(-1px);
}

.popup-body .btn-connect:active {
    transform: translateY(1px);
}

.btn-connect .btn-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    opacity: 0;
    display: none;
}

.btn-connect.loading .btn-text {
    opacity: 0;
}

.btn-connect.loading .btn-loader {
    opacity: 1;
    display: block;
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1100;
    transform: translateX(150%);
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.notification.active {
    transform: translateX(0);
}

.notification-content {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4CAF50;
    position: relative;
}

.notification-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.notification-message {
    color: #333;
    font-size: 14px;
    font-weight: 500;
}
