/* Styles pour le système d'achat de la galerie */

/* Popup menu d'actions */
.action-popup-menu {
    display: none;
    position: absolute;
    z-index: 9999;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    min-width: 280px;
    animation: popupFadeIn 0.2s ease;
}

.action-popup-menu.active {
    display: block;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.action-popup-content {
    padding: 20px;
}

.action-popup-close {
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.3s;
}

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

.action-popup-title {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 500;
    color: #333;
}

.action-popup-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-popup-buttons .btn {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
}

.action-prix-display {
    display: block;
    font-size: 12px;
    margin-top: 3px;
    font-weight: bold;
}

/* Modals d'achat */
.modal-achat {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    animation: modalFadeIn 0.3s ease;
}

.modal-achat.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-achat-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-achat-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 32px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
}

.modal-achat-close:hover {
    color: #333;
}

.modal-achat h4 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 24px;
}

.modal-achat-body {
    margin-top: 20px;
}

/* Formulaires */
.form-group {
    margin-bottom: 20px;
}

.input-with-button {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

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

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
    box-sizing: border-box;
    background-color: #fff;
    color: #333;
}

.form-control:focus {
    outline: none;
    border-color: #ff6f00;
    box-shadow: 0 0 0 2px rgba(255, 111, 0, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
    background-color: #fff;
    color: #333;
}

.captcha-group {
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.captcha-group label {
    color: #333;
    font-weight: 600;
}

#captchaQuestion {
    color: #ff6f00;
    font-weight: bold;
    font-size: 16px;
}

/* Messages */
.message-box {
    margin-top: 15px;
    padding: 12px;
    border-radius: 4px;
    display: none;
}

.message-box.success {
    display: block;
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message-box.error {
    display: block;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message-box.info {
    display: block;
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* PayPal button container */
#paypal-button-container {
    margin-top: 20px;
    min-height: 50px;
}

/* Boutons */
.modal-achat .btn {
    margin-top: 10px;
}

.btn-coller {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 16px;
    background-color: #ff6f00;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s;
    white-space: nowrap;
}

.btn-coller:hover {
    background-color: #f57c00;
}

.btn-coller:active {
    background-color: #e65100;
}

.btn-coller i {
    font-size: 18px;
}

.input-with-button .form-control {
    flex: 1;
}

/* Responsive */
@media screen and (max-width: 600px) {
    .modal-achat-content {
        padding: 20px;
        width: 95%;
    }

    .modal-achat h4 {
        font-size: 20px;
    }

    .action-popup-menu {
        min-width: 240px;
    }

    .action-popup-content {
        padding: 15px;
    }

    .action-popup-title {
        font-size: 16px;
    }

    .input-with-button {
        flex-direction: column;
    }

    .btn-coller {
        width: 100%;
        justify-content: center;
    }
}

/* Animation de chargement */
.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #ff6f00;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

.disabled {
    opacity: 0.6;
    pointer-events: none;
}

/* Support du thème dark */
@media (prefers-color-scheme: dark) {
    /* Modals d'achat en thème dark */
    .modal-achat-content {
        background-color: #1e1e1e;
        color: #e0e0e0;
    }

    .modal-achat h4 {
        color: #ffffff;
    }

    .modal-achat-close {
        color: #aaa;
    }

    .modal-achat-close:hover {
        color: #fff;
    }

    /* Labels des formulaires */
    .form-group label {
        color: #e0e0e0;
        font-weight: 600;
    }

    /* Inputs et textarea */
    .form-control {
        background-color: #2d2d2d;
        color: #ffffff;
        border: 1px solid #555;
    }

    .form-control:focus {
        border-color: #ff6f00;
        background-color: #333;
        box-shadow: 0 0 0 2px rgba(255, 111, 0, 0.2);
    }

    textarea.form-control {
        background-color: #2d2d2d;
        color: #ffffff;
    }

    /* Groupe captcha */
    .captcha-group {
        background-color: #2d2d2d;
        border: 1px solid #555;
    }

    .captcha-group label {
        color: #e0e0e0;
    }

    #captchaQuestion {
        color: #ffa726;
    }

    /* Popup menu d'actions */
    .action-popup-menu {
        background-color: #1e1e1e;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    }

    .action-popup-title {
        color: #ffffff;
    }

    .action-popup-close {
        color: #aaa;
    }

    .action-popup-close:hover {
        color: #fff;
    }

    /* Messages */
    .message-box.success {
        background-color: #1b4d2c;
        color: #90ee90;
        border: 1px solid #2d6a3e;
    }

    .message-box.error {
        background-color: #4d1b1b;
        color: #ff9999;
        border: 1px solid #6a2d2d;
    }

    .message-box.info {
        background-color: #1b3d4d;
        color: #87ceeb;
        border: 1px solid #2d566a;
    }
}

/* Support alternatif pour les sites avec classe .dark-theme sur body */
body.dark-theme .modal-achat-content,
html.dark-theme .modal-achat-content {
    background-color: #1e1e1e;
    color: #e0e0e0;
}

body.dark-theme .modal-achat h4,
html.dark-theme .modal-achat h4 {
    color: #ffffff;
}

body.dark-theme .modal-achat-close,
html.dark-theme .modal-achat-close {
    color: #aaa;
}

body.dark-theme .modal-achat-close:hover,
html.dark-theme .modal-achat-close:hover {
    color: #fff;
}

body.dark-theme .form-group label,
html.dark-theme .form-group label {
    color: #e0e0e0;
    font-weight: 600;
}

body.dark-theme .form-control,
html.dark-theme .form-control {
    background-color: #2d2d2d;
    color: #ffffff;
    border: 1px solid #555;
}

body.dark-theme .form-control:focus,
html.dark-theme .form-control:focus {
    border-color: #ff6f00;
    background-color: #333;
    box-shadow: 0 0 0 2px rgba(255, 111, 0, 0.2);
}

body.dark-theme textarea.form-control,
html.dark-theme textarea.form-control {
    background-color: #2d2d2d;
    color: #ffffff;
}

body.dark-theme .captcha-group,
html.dark-theme .captcha-group {
    background-color: #2d2d2d;
    border: 1px solid #555;
}

body.dark-theme .captcha-group label,
html.dark-theme .captcha-group label {
    color: #e0e0e0;
}

body.dark-theme #captchaQuestion,
html.dark-theme #captchaQuestion {
    color: #ffa726;
}

body.dark-theme .action-popup-menu,
html.dark-theme .action-popup-menu {
    background-color: #1e1e1e;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

body.dark-theme .action-popup-title,
html.dark-theme .action-popup-title {
    color: #ffffff;
}

body.dark-theme .action-popup-close,
html.dark-theme .action-popup-close {
    color: #aaa;
}

body.dark-theme .action-popup-close:hover,
html.dark-theme .action-popup-close:hover {
    color: #fff;
}

body.dark-theme .message-box.success,
html.dark-theme .message-box.success {
    background-color: #1b4d2c;
    color: #90ee90;
    border: 1px solid #2d6a3e;
}

body.dark-theme .message-box.error,
html.dark-theme .message-box.error {
    background-color: #4d1b1b;
    color: #ff9999;
    border: 1px solid #6a2d2d;
}

body.dark-theme .message-box.info,
html.dark-theme .message-box.info {
    background-color: #1b3d4d;
    color: #87ceeb;
    border: 1px solid #2d566a;
}
