/**
 * CCD 50/50 Raffle - Frontend Styles
 */

/* Purchase Form */
.ccd-raffle-purchase {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #cc0000;
    border-radius: 12px;
    padding: 25px;
    margin: 20px 0;
    max-width: 400px;
}

.ccd-raffle-purchase h3 {
    color: #1a1a2e;
    margin: 0 0 15px 0;
    font-size: 1.4em;
}

.ccd-raffle-purchase .raffle-description {
    color: #666;
    font-size: 0.95em;
    margin-bottom: 15px;
    line-height: 1.5;
}

.ccd-raffle-purchase .current-pot {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.ccd-raffle-purchase .current-pot .winner-share {
    color: #28a745;
    display: block;
    font-size: 0.9em;
    margin-top: 5px;
}

.ccd-raffle-purchase .ticket-price {
    font-size: 1.3em;
    color: #cc0000;
    margin-bottom: 20px;
}

/* Quantity Selector */
.ccd-raffle-purchase .quantity-selector {
    margin-bottom: 20px;
}

.ccd-raffle-purchase .quantity-selector label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.ccd-raffle-purchase .qty-buttons {
    display: flex;
    align-items: center;
    gap: 0;
}

.ccd-raffle-purchase .qty-btn {
    width: 44px;
    height: 44px;
    border: 2px solid #cc0000;
    background: #fff;
    color: #cc0000;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ccd-raffle-purchase .qty-btn.minus {
    border-radius: 8px 0 0 8px;
    border-right: none;
}

.ccd-raffle-purchase .qty-btn.plus {
    border-radius: 0 8px 8px 0;
    border-left: none;
}

.ccd-raffle-purchase .qty-btn:hover {
    background: #cc0000;
    color: #fff;
}

.ccd-raffle-purchase .qty-input {
    width: 70px;
    height: 44px;
    border: 2px solid #cc0000;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    -moz-appearance: textfield;
}

.ccd-raffle-purchase .qty-input::-webkit-outer-spin-button,
.ccd-raffle-purchase .qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Total Display */
.ccd-raffle-purchase .total-display {
    font-size: 1.4em;
    font-weight: bold;
    color: #1a1a2e;
    margin-bottom: 20px;
    padding: 10px;
    background: #fff;
    border-radius: 8px;
    text-align: center;
}

.ccd-raffle-purchase .total-display #raffle-total {
    color: #cc0000;
}

/* Submit Button */
.ccd-raffle-purchase .raffle-submit {
    width: 100%;
    padding: 15px 30px;
    font-size: 1.1em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #cc0000 0%, #990000 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(204, 0, 0, 0.3);
}

.ccd-raffle-purchase .raffle-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(204, 0, 0, 0.4);
}

.ccd-raffle-purchase .raffle-note {
    margin-top: 15px;
    color: #666;
    font-size: 0.85em;
    text-align: center;
}

/* Raffle Closed Message */
.raffle-closed {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

/* Cart Item Event Name */
.raffle-event-name {
    display: block;
    color: #666;
    font-weight: normal;
}

/* Bundle Options */
.ccd-raffle-bundles .bundle-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin: 20px 0;
}

.ccd-raffle-bundles .bundle-option {
    border: 2px solid #ddd;
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    background: #fff;
}

.ccd-raffle-bundles .bundle-option:hover {
    border-color: #cc0000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.ccd-raffle-bundles .bundle-option.selected {
    border-color: #cc0000;
    background: linear-gradient(135deg, #fff5f5 0%, #ffe5e5 100%);
}

.ccd-raffle-bundles .bundle-name {
    font-weight: bold;
    font-size: 1.1em;
    display: block;
    margin-bottom: 5px;
}

.ccd-raffle-bundles .bundle-savings {
    background: #28a745;
    color: white;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
    margin-top: 5px;
}

.ccd-raffle-bundles .bundle-price {
    font-size: 1.6em;
    font-weight: bold;
    color: #cc0000;
    display: block;
    margin: 10px 0 5px;
}

.ccd-raffle-bundles .ticket-count {
    display: block;
    color: #666;
    font-size: 0.9em;
}

.ccd-raffle-bundles .per-ticket {
    font-size: 0.8em;
    color: #888;
}

/* Responsive */
@media (max-width: 480px) {
    .ccd-raffle-purchase {
        padding: 20px 15px;
    }
    
    .ccd-raffle-purchase h3 {
        font-size: 1.2em;
    }
    
    .ccd-raffle-bundles .bundle-options {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================
   Cart Page Raffle Upsell
   ========================================== */

/* Upsell section after cart table */
.ccd-raffle-upsell-section {
    clear: both;
    background: #fff;
    border: 2px solid #cc0000;
    border-radius: 12px;
    padding: 25px;
    margin: 30px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.ccd-raffle-upsell-section .raffle-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.ccd-raffle-upsell-section h3 {
    margin: 0 0 8px 0;
    color: #1a1a2e;
    font-size: 1.4em;
}

.ccd-raffle-upsell-section .raffle-description {
    color: #666;
    margin: 0;
    font-size: 0.95em;
    line-height: 1.5;
}

/* Individual event upsell card */
.raffle-event-upsell {
    background: #f9f9f9;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    border: 1px solid #e5e5e5;
}

.raffle-event-upsell:last-child {
    margin-bottom: 0;
}

.raffle-event-upsell .event-info {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.raffle-event-upsell .event-info strong {
    font-size: 1.1em;
    color: #1a1a2e;
}

.raffle-event-upsell .event-date {
    color: #666;
    font-size: 0.9em;
}

.raffle-event-upsell .current-pot {
    background: #d4edda;
    color: #155724;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

/* Quick add buttons */
.raffle-options .quick-add-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.quick-add-btn {
    background: linear-gradient(135deg, #cc0000 0%, #990000 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    min-width: 100px;
}

.quick-add-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(204, 0, 0, 0.3);
}

.quick-add-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

.quick-add-btn .qty {
    display: block;
    font-weight: 600;
    font-size: 0.95em;
}

.quick-add-btn .price {
    display: block;
    font-size: 1.2em;
    font-weight: bold;
    margin-top: 3px;
}

/* Custom quantity */
.custom-qty-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.or-divider {
    color: #999;
    font-style: italic;
}

.custom-qty-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.raffle-custom-qty {
    width: 80px;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    text-align: center;
    font-size: 16px;
}

.raffle-custom-qty:focus {
    border-color: #cc0000;
    outline: none;
}

.add-custom-btn {
    background: #333;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.add-custom-btn:hover {
    background: #000;
}

.price-per-ticket {
    color: #666;
    font-size: 0.9em;
}

/* Already added state */
.already-added {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
}

/* Responsive */
@media (max-width: 600px) {
    .ccd-raffle-upsell-section {
        padding: 20px 15px;
        margin: 20px 0;
    }
    
    .quick-add-buttons {
        justify-content: center;
    }
    
    .quick-add-btn {
        flex: 1;
        min-width: 90px;
    }
    
    .custom-qty-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    .custom-qty-row {
        justify-content: center;
    }
    
    .raffle-event-upsell .event-info {
        flex-direction: column;
        align-items: flex-start;
    }
}
