/**
 * Styles pour l'interface publique
 *
 * @package Zoho_Bigin_Integration
 */

/* ===== MESSAGES D'ACCÈS REFUSÉ ===== */
.zbi-access-denied {
    background-color: #f8d7da;
    color: #721c24;
    padding: 15px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 15px 0;
}

/* ===== SÉLECTEUR DE SOCIÉTÉ ===== */
.zbi-company-selector-container {
    margin: 15px 0;
}

.zbi-company-selector-container label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.zbi-company-selector {
    padding: 8px 10px;
    width: 100%;
    max-width: 300px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
}

.zbi-company-change-status {
    display: inline-block;
    margin-left: 10px;
    vertical-align: middle;
}

.zbi-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-left-color: #5D5CDE;
    border-radius: 50%;
    animation: zbi-spin 1s linear infinite;
}

@keyframes zbi-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.zbi-success {
    color: #155724;
    font-size: 14px;
}

.zbi-error {
    color: #721c24;
    font-size: 14px;
}

/* ===== BOUTONS DE SÉLECTION DE SOCIÉTÉ ===== */
.zbi-company-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0;
}

.zbi-company-button {
    padding: 8px 15px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: #333;
}

.zbi-company-button:hover {
    background-color: #f1f1f1;
    border-color: #ccc;
}

.zbi-company-button.active {
    background-color: #5D5CDE;
    border-color: #5D5CDE;
    color: #fff;
}

/* ===== AFFICHAGE DES DROITS UTILISATEUR ===== */
.zbi-user-rights {
    margin: 15px 0;
}

.zbi-user-rights h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 18px;
    font-weight: 500;
}

.zbi-user-rights ul {
    list-style: disc inside;
    margin: 0;
    padding: 0;
}

.zbi-user-rights li {
    margin-bottom: 5px;
}

/* ===== AFFICHAGE DES SOCIÉTÉS UTILISATEUR ===== */
.zbi-user-companies {
    margin: 15px 0;
}

.zbi-user-companies h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 18px;
    font-weight: 500;
}

.zbi-user-companies ul {
    list-style: disc inside;
    margin: 0;
    padding: 0;
}

.zbi-user-companies li {
    margin-bottom: 5px;
}

.zbi-user-companies .zbi-primary-company {
    font-weight: 700;
    color: #5D5CDE;
}

/* ===== WIDGET DE SÉLECTION DE SOCIÉTÉ ===== */
.widget_zbi_company_selector_widget {
    margin-bottom: 20px;
}

.widget_zbi_company_selector_widget .widget-title {
    margin-bottom: 10px;
}

/* ===== SUPPORT DU MODE SOMBRE ===== */
@media (prefers-color-scheme: dark) {
    .zbi-access-denied {
        background-color: rgba(248, 215, 218, 0.1);
        color: #ff6b6b;
        border-color: rgba(245, 198, 203, 0.2);
    }
    
    .zbi-company-selector {
        background-color: #333;
        border-color: #555;
        color: #fff;
    }
    
    .zbi-company-button {
        background-color: #333;
        border-color: #555;
        color: #eee;
    }
    
    .zbi-company-button:hover {
        background-color: #444;
        border-color: #666;
    }
    
    .zbi-company-button.active {
        background-color: #5D5CDE;
        border-color: #5D5CDE;
        color: #fff;
    }
    
    .zbi-loading {
        border-color: rgba(255, 255, 255, 0.1);
        border-left-color: #5D5CDE;
    }
    
    .zbi-success {
        color: #75b798;
    }
    
    .zbi-error {
        color: #ff6b6b;
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .zbi-company-buttons {
        flex-direction: column;
        gap: 5px;
    }
    
    .zbi-company-button {
        width: 100%;
        text-align: center;
    }
}