/* Styles Djomy Payment Gateway */

.payment_method_djomy {
    position: relative;
}

.payment_method_djomy .payment_box {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-top: 15px;
}

.djomy-logo {
    max-height: 30px;
    vertical-align: middle;
    margin-right: 10px;
}

.djomy-payment-form {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.djomy-payment-methods {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 15px 0;
}

.djomy-method {
    flex: 1;
    min-width: 120px;
    text-align: center;
    padding: 15px 10px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.djomy-method:hover {
    border-color: #007cba;
    background: #f0f8ff;
}

.djomy-method.selected {
    border-color: #007cba;
    background: #e6f3ff;
}

.djomy-method img {
    max-width: 60px;
    max-height: 40px;
    margin-bottom: 8px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.djomy-method-name {
    font-weight: bold;
    font-size: 14px;
    color: #333;
}

.djomy-phone-input {
    margin: 15px 0;
}

.djomy-phone-input label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.djomy-phone-input input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
}

.djomy-phone-input input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

.djomy-submit-button {
    background: #007cba;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    transition: background 0.3s ease;
}

.djomy-submit-button:hover {
    background: #005a87;
}

.djomy-submit-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.djomy-loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.djomy-loading.active {
    display: block;
}

.djomy-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

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

.djomy-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 10px 15px;
    margin: 10px 0;
}

.djomy-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    padding: 10px 15px;
    margin: 10px 0;
}

.djomy-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    border-radius: 4px;
    padding: 10px 15px;
    margin: 10px 0;
}

/* Animations et transitions */
.djomy-method {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
}

.djomy-method:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.15);
}

.djomy-method.selected {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.25);
}

.djomy-method.suggested {
    border-color: #28a745;
    background: #f8fff9;
    animation: suggest-pulse 2s infinite;
}

@keyframes suggest-pulse {
    0% { border-color: #28a745; }
    50% { border-color: #40e062; }
    100% { border-color: #28a745; }
}

/* États des champs */
.djomy-phone-input input.valid {
    border-color: #28a745;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2);
}

.djomy-phone-input input.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
}

/* Responsive design */
@media (max-width: 768px) {
    .djomy-payment-methods {
        flex-direction: column;
    }

    .djomy-method {
        min-width: auto;
        margin-bottom: 10px;
    }

    .djomy-methods-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .djomy-methods-grid {
        grid-template-columns: 1fr;
    }

    .djomy-payment-form {
        padding: 15px;
        margin: 10px 0;
    }
}

/* États de chargement */
.djomy-payment-form.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.djomy-payment-form.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 10;
}

/* Messages d'erreur de formulaire */
.djomy-form-errors {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 15px;
    margin: 15px 0;
}

.djomy-form-errors ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.djomy-form-errors li {
    margin: 5px 0;
    padding-left: 20px;
    position: relative;
}

.djomy-form-errors li::before {
    content: '⚠';
    position: absolute;
    left: 0;
    color: #721c24;
}

/* Styles pour les pages admin */
.djomy-admin-section {
    background: white;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 20px;
    margin: 20px 0;
}

.djomy-admin-section h3 {
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.djomy-status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.djomy-status-indicator.success {
    background: #28a745;
}

.djomy-status-indicator.pending {
    background: #ffc107;
}

.djomy-status-indicator.failed {
    background: #dc3545;
}

/* Tableau des transactions */
.djomy-transactions-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.djomy-transactions-table th,
.djomy-transactions-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.djomy-transactions-table th {
    background: #f8f9fa;
    font-weight: bold;
}

.djomy-transactions-table tr:hover {
    background: #f5f5f5;
}

/* Boutons d'action */
.djomy-action-buttons {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

.djomy-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    transition: background 0.3s ease;
}

.djomy-btn-primary {
    background: #007cba;
    color: white;
}

.djomy-btn-primary:hover {
    background: #005a87;
    color: white;
}

.djomy-btn-secondary {
    background: #6c757d;
    color: white;
}

.djomy-btn-secondary:hover {
    background: #545b62;
    color: white;
}

.djomy-btn-danger {
    background: #dc3545;
    color: white;
}

.djomy-btn-danger:hover {
    background: #c82333;
    color: white;
}

.djomy-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Notifications toast */
.djomy-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    max-width: 400px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.djomy-toast.show {
    transform: translateX(0);
}

.djomy-toast.success {
    border-left: 4px solid #28a745;
}

.djomy-toast.error {
    border-left: 4px solid #dc3545;
}

.djomy-toast.info {
    border-left: 4px solid #17a2b8;
}

/* Mode sombre (si supporté par le thème) */
@media (prefers-color-scheme: dark) {
    .djomy-payment-form {
        background: #2c3e50;
        border-color: #34495e;
        color: #ecf0f1;
    }

    .djomy-method {
        background: #34495e;
        border-color: #4a5f7a;
        color: #ecf0f1;
    }

    .djomy-method:hover {
        background: #3a526b;
    }

    .djomy-method.selected {
        background: #2980b9;
        border-color: #3498db;
    }

    .djomy-phone-input input {
        background: #34495e;
        border-color: #4a5f7a;
        color: #ecf0f1;
    }

    .djomy-phone-input input:focus {
        border-color: #3498db;
    }
}

/* Améliorations d'accessibilité */
.djomy-method:focus-within {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.djomy-phone-input input:focus {
    outline: none;
}

/* Indicateurs de chargement avancés */
.djomy-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Styles pour les captures d'écran et démonstrations */
.djomy-demo-container {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    margin: 20px 0;
    background: #fafafa;
}

.djomy-demo-container.active {
    border-color: #007cba;
    background: #f0f8ff;
}