/**
 * Tombola Ticket Manager - Premium Frontend Styles
 */

/* Buy Buttons */
.tombola-buy-button {
    display: inline-block;
    padding: 16px 40px;
    background: linear-gradient(135deg, #FF6B6B 0%, #EE5253 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-decoration: none;
    box-shadow: 0 10px 30px rgba(238, 82, 83, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.tombola-buy-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(238, 82, 83, 0.4);
}

.tombola-buy-button:active {
    transform: translateY(1px);
    box-shadow: 0 5px 15px rgba(238, 82, 83, 0.3);
}

.tombola-buy-obligatoire {
    background: linear-gradient(135deg, #5F27CD 0%, #341F97 100%);
    box-shadow: 0 10px 30px rgba(95, 39, 205, 0.3);
}

.tombola-buy-obligatoire:hover {
    box-shadow: 0 15px 35px rgba(95, 39, 205, 0.4);
}

.tombola-buy-supplementaire {
    background: linear-gradient(135deg, #10AC84 0%, #1DD1A1 100%);
    box-shadow: 0 10px 30px rgba(16, 172, 132, 0.3);
}

.tombola-buy-supplementaire:hover {
    box-shadow: 0 15px 35px rgba(16, 172, 132, 0.4);
}

/* Modal Overlay */
.tombola-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.4s ease;
    backdrop-filter: blur(8px);
    background: rgba(10, 10, 20, 0.6);
}

.tombola-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Modal Content Card */
.tombola-modal-content {
    position: relative;
    background: #ffffff;
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    z-index: 2;
    animation: slideUp 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Close Button */
.tombola-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 24px;
    color: #fff;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
    backdrop-filter: blur(4px);
}

.tombola-modal-close:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: rotate(90deg) scale(1.1);
}

/* Header */
.tombola-modal-header {
    background: linear-gradient(135deg, #2D3436 0%, #000000 100%);
    padding: 50px 40px 30px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.tombola-modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.05' fill-rule='evenodd'%3E%3Ccircle cx='3' cy='3' r='3'/%3E%3Ccircle cx='13' cy='13' r='3'/%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.3;
}

.tombola-modal-header h2 {
    margin: 0;
    font-size: 28px;
    letter-spacing: -0.5px;
    font-weight: 800;
    position: relative;
    z-index: 1;
    color: #ffffff !important;
}

/* Body */
.tombola-modal-body {
    padding: 40px;
}

/* Package Info Card inside Modal */
.tombola-package-info {
    background: #F8F9FA;
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 30px;
    border: 1px solid #E9ECEF;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tombola-package-info h3 {
    margin: 0;
    font-size: 16px;
    color: #495057;
    font-weight: 600;
}

.tombola-price-value {
    font-size: 24px;
    font-weight: 800;
    color: #2D3436;
}

/* Form Fields */
.tombola-form-field {
    margin-bottom: 24px;
    position: relative;
}

.tombola-form-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2D3436;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tombola-form-field input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #F1F3F5;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #F8F9FA;
    color: #2D3436;
    box-sizing: border-box;
}

.tombola-form-field input:focus {
    outline: none;
    border-color: #6C5CE7;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.1);
}

.tombola-field-description {
    font-size: 12px;
    color: #868e96;
    margin-top: 6px;
    font-style: italic;
}

/* Total Section */
.tombola-total-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    margin: 30px 0;
    background: #F1F3F5;
    border-radius: 12px;
    font-size: 18px;
}

.tombola-total-amount {
    font-size: 28px;
    font-weight: 900;
    color: #6C5CE7;
}

/* Messages */
.tombola-message {
    padding: 15px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 500;
}

.tombola-message-error {
    background: #FFF5F5;
    color: #E03131;
    border: 1px solid #FFC9C9;
}

.tombola-message-success {
    background: #EBFBEE;
    color: #2F9E44;
    border: 1px solid #B2F2BB;
}

/* Actions */
.tombola-form-actions {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 16px;
    margin-top: 30px;
}

.tombola-btn {
    padding: 18px 24px;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
}

.tombola-btn-primary {
    background: linear-gradient(135deg, #6C5CE7 0%, #a29bfe 100%);
    color: #fff;
    box-shadow: 0 10px 20px rgba(108, 92, 231, 0.3);
}

.tombola-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(108, 92, 231, 0.4);
}

.tombola-btn-secondary {
    background: #fff;
    color: #868e96;
    border: 2px solid #F1F3F5;
}

.tombola-btn-secondary:hover {
    background: #F8F9FA;
    color: #495057;
    border-color: #DEE2E6;
}

/* Success Modal Styles */
.tombola-success-content {
    /* Reset styles to ensure conflicts don't break layout */
    text-align: center;
    max-width: 480px;
    padding: 0;
    overflow: hidden;
    background: white;
}

.tombola-success-header {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    padding: 50px 30px 30px;
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.tombola-success-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.1' fill-rule='evenodd'%3E%3Ccircle cx='3' cy='3' r='3'/%3E%3Ccircle cx='13' cy='13' r='3'/%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.3;
}

.tombola-success-icon {
    font-size: 72px;
    margin-bottom: 20px;
    display: block;
    animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.tombola-success-header h2 {
    margin: 0;
    font-size: 32px;
    font-weight: 800;
    color: #ffffff !important;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

.tombola-success-body {
    padding: 40px 30px;
}

.tombola-success-body p {
    font-size: 16px;
    color: #495057;
    line-height: 1.6;
    margin-bottom: 20px;
}

.tombola-success-note {
    margin-top: 25px;
    font-weight: 700;
    font-size: 18px !important;
    color: #2ecc71 !important;
    display: block;
}

.tombola-success-actions {
    margin-top: 30px;
}

/* Loading Spinner */
.tombola-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.tombola-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(108, 92, 231, 0.1);
    border-left-color: #6C5CE7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

/* Animations */
@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(40px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes popIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Mobile */
@media screen and (max-width: 480px) {
    .tombola-modal-content {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        max-width: none;
    }

    .tombola-modal-header {
        padding: 40px 30px 20px;
    }

    .tombola-modal-body {
        padding: 30px;
    }

    .tombola-form-actions {
        grid-template-columns: 1fr;
    }

    .tombola-btn-secondary {
        order: 2;
    }
}