/* Cursos Recurrents - Public Styles */

.cursos-dashboard-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.cursos-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.cursos-card h3 {
    margin: 0 0 20px;
    font-size: 18px;
    color: #333;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.cursos-status-badge {
    margin-bottom: 20px;
}

.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

.badge-active {
    background: #d4edda;
    color: #155724;
}

.badge-cancelled {
    background: #f8d7da;
    color: #721c24;
}

.badge-expired {
    background: #e2e3e5;
    color: #383d41;
}

.badge-available {
    background: #d1ecf1;
    color: #0c5460;
}

.badge-full {
    background: #f8d7da;
    color: #721c24;
}

.cursos-info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.cursos-info-row:last-child {
    border-bottom: none;
}

.cursos-info-row .label {
    color: #666;
    font-size: 14px;
}

.cursos-info-row .value {
    color: #333;
    font-weight: bold;
    font-size: 14px;
}

.cursos-progress-section {
    margin: 20px 0;
    padding: 15px 0;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
    padding: 15px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
    color: #666;
}

.progress-bar {
    background: #e0e0e0;
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 11px;
    font-weight: bold;
}

.cursos-slot-info {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    border-left: 4px solid #667eea;
}

.slot-time {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
    font-size: 16px;
}

.slot-places {
    font-size: 13px;
    color: #666;
}

.cursos-info-text {
    padding: 10px;
    background: #fff3cd;
    border-left: 3px solid #ffc107;
    color: #856404;
    margin-top: 10px;
    border-radius: 4px;
}

.cursos-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    width: 100%;
}

.cursos-btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.cursos-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.cursos-btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
}

.cursos-btn-secondary:hover {
    background: #e0e0e0;
}

/* Modal Styles */
.cursos-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
}

.cursos-modal-content {
    background: white;
    margin: 5% auto;
    padding: 25px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    animation: slideDown 0.3s ease;
}

.cursos-modal-close {
    color: #999;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

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

.cursos-modal h2 {
    margin-bottom: 15px;
    color: #333;
    font-size: 20px;
}

.cursos-modal p {
    color: #666;
    margin-bottom: 15px;
}

.cursos-slots-list {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
    max-height: 300px;
    overflow-y: auto;
}

.cursos-slot-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    margin-bottom: 10px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cursos-slot-option:hover:not(.disabled) {
    border-color: #667eea;
    background: #f5f7ff;
}

.cursos-slot-option input[type="radio"] {
    margin-top: 4px;
    cursor: pointer;
}

.cursos-slot-option.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cursos-slot-option .slot-name {
    font-weight: bold;
    color: #333;
    flex: 1;
}

.cursos-slot-option .slot-availability {
    font-size: 12px;
    color: #999;
}

.cursos-modal-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 20px;
}

.cursos-modal-buttons .cursos-btn {
    width: 100%;
    margin-top: 0;
}

/* --- Recurring course product page ---------------------------------
   The Suppre theme renders form.cart as `display:flex; flex-wrap:wrap`,
   so anything we echo on woocommerce_before_add_to_cart_button becomes a
   flex item and lands on the same row as the quantity box. flex-basis:100%
   forces it onto its own line without touching the theme's own layout. */
.cursos-no-slots,
.cursos-slot-picker {
    flex: 0 0 100%;
    width: 100%;
}

.cursos-no-slots {
    margin: 0;
    padding: 12px 15px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    color: #856404;
    border-radius: 4px;
}

.cursos-slot-picker-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
}

/* Label + quantity box stacked as one left-aligned unit */
.cursos-quantity-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 10px;
}

.single-product div.product form.cart .suppre-quantity-label {
    margin-bottom: 0 !important;
}

/* On course products only, stack the add-to-cart button under the quantity
   box instead of sharing its row. The theme gives the button `flex: 1` so it
   fills the space left beside the quantity; `flex: 0 0 100%` claims a full
   row of the same flex-wrap container. Scoped by the body/product class the
   plugin adds, with a :has() variant for setups where the add-to-cart form
   is rendered outside div.product (Elementor templates). */
.single-product div.product.cursos-recurrent-product form.cart .single_add_to_cart_button,
.single-product div.product form.cart:has(.cursos-slot-picker) .single_add_to_cart_button,
.single-product div.product form.cart:has(.cursos-no-slots) .single_add_to_cart_button {
    flex: 0 0 100%;
}

/* Availability Section */
.cursos-availability-wrapper {
    margin: 20px 0;
}

.cursos-availability-wrapper h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #333;
}

.cursos-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.cursos-slot-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cursos-slot-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.cursos-slot-card h3 {
    margin: 0 0 10px;
    font-size: 16px;
    color: #333;
}

.cursos-slot-card .progress-bar {
    margin: 10px 0;
}

.slot-stats {
    font-size: 13px;
    color: #666;
    margin: 10px 0;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Responsive */
@media (max-width: 768px) {
    .cursos-dashboard-wrapper {
        grid-template-columns: 1fr;
    }

    .cursos-modal-content {
        width: 95%;
        margin: 20% auto;
    }

    .cursos-modal-buttons {
        grid-template-columns: 1fr;
    }

    .cursos-slots-grid {
        grid-template-columns: 1fr;
    }

    .cursos-info-row {
        flex-direction: column;
        gap: 5px;
    }
}
