/*
 * Tracool Shop Validation de commande en backoffice
 * 
 * This file contains styles for the B2B catalogue in the Tracool Shop plugin.
 * author : tracool-Software
 * version: 1.1.0
 */

table.tc-commande .status { 
    min-width: 60px; 
    padding: 1px 5px;
    text-align: center;
    font-weight: 700;
}

table.tc-commande .pending        { background-color: lightcoral !important; }
table.tc-commande .on-hold        { background-color: lightgreen !important; }
table.tc-commande .processing     { background-color: limegreen !important; }
table.tc-commande .checkout-draft { background-color: lightgray !important; }
table.tc-commande .problem        { background-color: red !important; color: white !important; }
table.tc-commande .completed      { background-color: yellow !important; }
table.tc-commande .transmis       { background-color: yellow !important; }

table.tc-commande .gauche {
    text-align: left;
}
table.tc-commande .centre {
    text-align: center;
}
table.tc-commande .droite {
    text-align: right;
}
table.tc-commande th {
    padding: 1px 3vw;
}
table.tc-commande td {
    padding: 5px 3vw;
}
table.tc-commande a {
    text-decoration: none;
    text-wrap-mode: nowrap;
}


#order-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    max-width: 90%;
    background-color: #fff;
    border: 2px solid #333;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
    z-index: 9999;
    padding: 20px;
    display: none;
}

/* Contenu de la commande */
#order-content {
    margin-bottom: 20px;
    font-size: 16px;
    color: #333;
}

/* Bouton d'action */
#mark-complete {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

#mark-complete:hover {
    background-color: #218838;
}

/* Optionnel : fond semi-transparent derrière la popup */
#popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
    display: none;
}

.tc-close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 10000;
}

.tc-close-button:hover {
    color: #e74c3c;
}

#order-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    max-width: 90%;
    max-height: 90vh; /* Limite la hauteur à 90% de la fenêtre */
    overflow-y: auto; /* Active le scroll vertical si nécessaire */
    background-color: #fff;
    border: 2px solid #333;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
    z-index: 9999;
    padding: 20px;
}

.tc-popup-button {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 15px;
    font-size: 16px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    margin-right: 10px;
    line-height: var(--wp--custom--typography--line-height--normal);
}

.tc-popup-button.completed {
    background-color: #007bff;
    color: white;
}

.tc-popup-button.completed:hover {
    background-color: #0056b3;
}

.tc-popup-button:not(.completed) {
    background-color: #28a745;
    color: white;
    border: none;
}

.tc-popup-button:not(.completed):hover {
    background-color: #218838;
}

.tc-item-title {
    font-weight: bold;
}

#tc-close {
    margin-right: 0;
    right: 15px;
    position: fixed;
    background-color: #a0a0a0;
}

#tc-close:hover {
    background-color: #808080;
}

/* Sablier rotatif */
#tc-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

.tc-spinner {
    width: 50px;
    height: 50px;
    border: 6px solid #ccc;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
