/* Styles pour la boutique et l'authentification */

/* MODAL OVERLAY */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: #1a1f3a;
    border-radius: 12px;
    padding: 30px;
    max-width: 450px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-large {
    max-width: 700px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #2a2f4a;
}

.modal-header h2 {
    color: #00d4ff;
    font-size: 24px;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: #999;
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 1;
}

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

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

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    background: #0a0e27;
    border: 1px solid #2a2f4a;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #00d4ff;
}

.error-message {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid #f44336;
    color: #f44336;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
}

/* USER MENU */
.user-menu {
    position: relative;
}

.user-menu-button {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid #00d4ff;
    padding: 8px 15px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
}

.user-menu-button:hover {
    background: rgba(76, 175, 80, 0.2);
}

.user-skin {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    image-rendering: pixelated;
    background: #0a0e27;
}

.user-menu-button span {
    color: #fff;
    font-weight: 500;
}

.user-credits {
    background: #00d4ff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: #1a1f3a;
    border: 1px solid #2a2f4a;
    border-radius: 8px;
    min-width: 180px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    z-index: 1000;
}

.user-dropdown.active {
    display: block;
}

.user-dropdown a {
    display: block;
    padding: 12px 20px;
    color: #b8c5d6;
    text-decoration: none;
    transition: all 0.3s;
    border-bottom: 1px solid #333;
}

.user-dropdown a:last-child {
    border-bottom: none;
}

.user-dropdown a:hover {
    background: #3a3a3a;
    color: #00d4ff;
}

/* BOUTIQUE */
.shop-login-message {
    text-align: center;
    padding: 40px;
    background: rgba(76, 175, 80, 0.05);
    border: 2px dashed #00d4ff;
    border-radius: 12px;
    margin-bottom: 30px;
}

.shop-login-message p {
    font-size: 18px;
    margin-bottom: 20px;
    color: #b8c5d6;
}

.shop-categories {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.category-btn {
    padding: 12px 24px;
    background: #1a1f3a;
    border: 2px solid #2a2f4a;
    border-radius: 8px;
    color: #b8c5d6;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 16px;
    font-weight: 500;
}

.category-btn:hover {
    border-color: #00d4ff;
    color: #00d4ff;
}

.category-btn.active {
    background: #00d4ff;
    border-color: #00d4ff;
    color: #fff;
}

.shop-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 30px;
}

.product-card {
    background: #1a1f3a;
    border: 1px solid #2a2f4a;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
    border-color: #00d4ff;
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.2);
}

.product-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-content {
    padding: 20px;
}

.product-category {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid #00d4ff;
    border-radius: 12px;
    font-size: 12px;
    color: #00d4ff;
    margin-bottom: 10px;
}

.product-title {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 10px;
}

.product-description {
    color: #b8c5d6;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
    max-height: 60px;
    overflow: hidden;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #2a2f4a;
}

.product-price {
    font-size: 24px;
    font-weight: bold;
    color: #00d4ff;
}

.product-btn {
    padding: 10px 20px;
    background: #00d4ff;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.product-btn:hover {
    background: #45a049;
    transform: scale(1.05);
}

.product-modal-content {
    display: flex;
    gap: 30px;
}

.product-modal-image {
    width: 300px;
    height: 300px;
    border-radius: 8px;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
}

.product-modal-info {
    flex: 1;
}

.product-modal-category {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid #00d4ff;
    border-radius: 15px;
    font-size: 13px;
    color: #00d4ff;
    margin-bottom: 15px;
}

.product-modal-title {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 15px;
}

.product-modal-description {
    color: #b8c5d6;
    font-size: 15px;
    line-height: 1.8;
    margin-bottom: 25px;
}

.product-modal-price {
    font-size: 36px;
    font-weight: bold;
    color: #00d4ff;
    margin-bottom: 20px;
}

.product-modal-actions {
    display: flex;
    gap: 15px;
}

.product-modal-actions button {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-buy {
    background: #00d4ff;
    color: #fff;
}

.btn-buy:hover {
    background: #45a049;
}

.btn-cancel {
    background: #2a2f4a;
    color: #b8c5d6;
}

.btn-cancel:hover {
    background: #555;
    color: #fff;
}

.product-stock {
    margin-top: 15px;
    padding: 10px;
    background: rgba(255, 152, 0, 0.1);
    border-left: 3px solid #ff9800;
    color: #ff9800;
    font-size: 13px;
}

/* ===== PANIER ===== */

/* Bouton panier dans la navigation */
.cart-button {
    position: relative;
    background: transparent;
    border: 2px solid #00d4ff;
    color: #00d4ff;
    font-size: 16px;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cart-button:hover {
    background: #00d4ff;
    color: #1a1f3a;
    transform: scale(1.05);
}

.cart-button.has-items {
    background: rgba(0, 212, 255, 0.2);
    animation: pulse-cart 2s infinite;
}

@keyframes pulse-cart {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(0, 212, 255, 0); }
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    font-size: 11px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: none; /* Caché par défaut, JS le montre quand > 0 */
    align-items: center;
    justify-content: center;
    border: 2px solid #1a1f3a;
}

/* Contenu du panier */
.cart-items {
    max-height: 350px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #252a45;
    border-radius: 8px;
    margin-bottom: 10px;
}

.cart-item-image {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1f3a;
    border-radius: 8px;
    font-size: 24px;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    color: white;
    font-weight: bold;
    margin-bottom: 5px;
}

.cart-item-price {
    color: #888;
    font-size: 0.9em;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-item-quantity button {
    width: 30px;
    height: 30px;
    border: none;
    background: #00d4ff;
    color: #1a1f3a;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
}

.cart-item-quantity button:hover {
    background: #00b8e0;
}

.cart-item-quantity span {
    color: white;
    font-weight: bold;
    min-width: 30px;
    text-align: center;
}

.cart-item-total {
    color: #00d4ff;
    font-weight: bold;
    font-size: 1.1em;
    min-width: 70px;
    text-align: right;
}

.cart-item-remove {
    background: transparent;
    border: none;
    color: #ff4444;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
}

.cart-item-remove:hover {
    color: #ff6666;
}

/* Résumé du panier */
.cart-summary {
    border-top: 1px solid #2a2f4a;
    padding-top: 20px;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.cart-total span:first-child {
    color: #b8c5d6;
}

.cart-total-price {
    color: #00d4ff;
    font-weight: bold;
    font-size: 1.5em;
}

.cart-credits-info {
    color: #b8c5d6;
    margin-bottom: 20px;
    text-align: center;
}

.cart-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-cart-pay-credits {
    background: linear-gradient(135deg, #00d4ff, #00a8cc);
    color: #1a1f3a;
    border: none;
    padding: 15px 25px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cart-pay-credits:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
}

.btn-cart-pay-credits:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-cart-pay-paypal {
    background: #0070ba;
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cart-pay-paypal:hover {
    background: #005ea6;
    transform: translateY(-2px);
}

.btn-cart-clear {
    background: transparent;
    border: 1px solid #ff4444;
    color: #ff4444;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cart-clear:hover {
    background: rgba(255, 68, 68, 0.1);
}

/* Bouton ajouter au panier */
.btn-add-cart {
    background: linear-gradient(135deg, #00d4ff, #00a8cc);
    color: #1a1f3a;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-add-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
}

.product-warning {
    color: #ffaa00;
    background: rgba(255, 170, 0, 0.1);
    padding: 10px;
    border-radius: 8px;
    margin: 10px 0;
    font-size: 0.9em;
}

/* Responsive */
@media (max-width: 768px) {
    .shop-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }

    .product-modal-content {
        flex-direction: column;
    }

    .product-modal-image {
        width: 100%;
        height: 250px;
    }

    .user-menu-button span {
        display: none;
    }

    .user-credits {
        display: none;
    }

    .cart-item {
        flex-wrap: wrap;
    }

    .cart-item-info {
        flex: 1 1 60%;
    }

    .cart-item-quantity {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }

    .cart-item-total {
        order: 2;
    }
}
