/**
 * Frontend Styles for Tutor Course Dates
 */

.tcd-course-dates {
    margin: 30px 0;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tcd-heading {
    margin: 0 0 25px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.tcd-dates-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Date Item */
.tcd-date-item {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.tcd-date-item:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.tcd-date-item.tcd-sold-out {
    opacity: 0.6;
    background: #f5f5f5;
}

.tcd-date-item.tcd-sold-out:hover {
    transform: none;
    box-shadow: none;
}

/* Date Info */
.tcd-date-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.tcd-date-row {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.tcd-date-label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 100px;
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.tcd-date-label .dashicons {
    color: #2271b1;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.tcd-date-value {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333;
    font-size: 14px;
}

.tcd-date-value strong {
    font-weight: 600;
}

.tcd-time {
    color: #666;
    font-size: 13px;
}

.tcd-sold-out-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #dc3545;
    color: #fff;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Date Action */
.tcd-date-action {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    gap: 15px;
    min-width: 200px;
    padding-left: 20px;
    border-left: 2px solid #e0e0e0;
}

.tcd-price-per-person {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 10px 0;
}

.tcd-price+span {
    font-size: 1em;
    color: #777777;
}

.tcd-price {
    font-size: 28px;
    font-weight: 700;
    color: #2271b1;
    line-height: 1;
}

.tcd-price .woocommerce-Price-amount {
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
}

/* Quantity Selector */
.tcd-quantity-selector {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tcd-quantity-selector label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.tcd-quantity-input {
    display: flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    overflow: hidden;
}

.tcd-qty-minus,
.tcd-qty-plus {
    background: #f9f9f9;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tcd-qty-minus:hover,
.tcd-qty-plus:hover {
    background: #2271b1;
    color: #fff;
}

.tcd-qty-minus .dashicons,
.tcd-qty-plus .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.tcd-qty-field {
    width: 60px;
    text-align: center;
    border: none;
    border-left: 1px solid #d1d5db;
    border-right: 1px solid #d1d5db;
    padding: 8px 10px;
    font-size: 16px;
    font-weight: 600;
    -moz-appearance: textfield;
}

.tcd-qty-field::-webkit-outer-spin-button,
.tcd-qty-field::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.tcd-qty-field:focus {
    outline: none;
    background: #f9f9f9;
}

/* Book Button */
.tcd-book-btn {
    display: inline-block;
    padding: 12px 30px;
    background: #2271b1;
    color: #fff !important;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 140px;
}

.tcd-book-btn:hover {
    background: #135e96;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(34, 113, 177, 0.3);
}

.tcd-book-btn:active {
    transform: translateY(0);
}

.tcd-book-btn.tcd-btn-disabled,
.tcd-book-btn:disabled {
    background: #999;
    color: #fff !important;
    cursor: not-allowed;
    opacity: 0.6;
}

.tcd-book-btn.tcd-btn-disabled:hover,
.tcd-book-btn:disabled:hover {
    background: #999;
    transform: none;
    box-shadow: none;
}

.tcd-book-btn.loading {
    position: relative;
    color: transparent !important;
}

.tcd-book-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: tcd-spin 0.8s linear infinite;
}

@keyframes tcd-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Success Message */
.tcd-success-message {
    display: none;
    padding: 15px 20px;
    margin-bottom: 20px;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    font-weight: 500;
}

.tcd-success-message a {
    color: #155724;
    text-decoration: underline;
    font-weight: 600;
}

.tcd-success-message a:hover {
    color: #0c3d1a;
}

/* Error Message */
.tcd-error-message {
    display: none;
    padding: 15px 20px;
    margin-bottom: 20px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    font-weight: 500;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .tcd-course-dates {
        padding: 20px;
    }

    .tcd-heading {
        font-size: 20px;
    }

    .tcd-date-item {
        flex-direction: column;
        gap: 20px;
    }

    .tcd-date-action {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        min-width: 100%;
        padding-left: 0;
        padding-top: 20px;
        border-left: none;
        border-top: 2px solid #e0e0e0;
    }

    .tcd-price {
        font-size: 24px;
    }

    .tcd-book-btn {
        padding: 10px 20px;
        font-size: 14px;
        min-width: 120px;
    }

    .tcd-date-row {
        flex-direction: column;
        gap: 5px;
    }

    .tcd-date-label {
        min-width: auto;
    }
}

@media screen and (max-width: 480px) {
    .tcd-date-action {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .tcd-price {
        text-align: center;
    }

    .tcd-book-btn {
        width: 100%;
    }
}


/* Enquire Now (no dates) - form shown inline */
.tcd-enquire-now {
    margin-top: 1em;
}

.tcd-enquire-now .tcd-enquire-description {
    margin: 0 0 1.25em;
    color: #555;
    line-height: 1.5;
}

.tcd-enquire-now .tcd-enquire-form {
    max-width: 600px;
}

/* Legacy waiting list / no-dates (kept for modal) */
.tcd-no-dates-available {
    text-align: center;
    padding: 60px 20px;
}

.tcd-no-dates-icon {
    margin-bottom: 20px;
}

.tcd-no-dates-icon .dashicons {
    font-size: 64px;
    width: 64px;
    height: 64px;
    color: #cbd5e1;
}

.tcd-no-dates-available h4 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px;
}

.tcd-no-dates-available p {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto 24px;
}

.tcd-waiting-list-btn {
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
}

/* Modal Styles */
.tcd-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tcd-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    animation: tcd-fade-in 0.3s ease;
}

.tcd-modal-content {
    position: relative;
    background: #fff;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: tcd-slide-up 0.3s ease;
}

@keyframes tcd-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes tcd-slide-up {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

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

.tcd-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.tcd-modal-close:hover {
    background: #e0e0e0;
    transform: rotate(90deg);
}

.tcd-modal-close .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #666;
}

.tcd-modal-header {
    padding: 30px 30px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.tcd-modal-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
    padding-right: 40px;
}

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

.tcd-modal-body p {
    font-size: 15px;
    line-height: 1.6;
    color: #666;
    margin: 0 0 24px;
}

.tcd-form-container {
    margin-top: 20px;
}

body.tcd-modal-open {
    overflow: hidden;
}

/* Responsive Modal */
@media screen and (max-width: 768px) {
    .tcd-modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .tcd-modal-header {
        padding: 20px 20px 15px;
    }

    .tcd-modal-header h3 {
        font-size: 20px;
    }

    .tcd-modal-body {
        padding: 20px;
    }
}

/* Responsive Quantity */
@media screen and (max-width: 768px) {
    .tcd-quantity-selector {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .tcd-date-action {
        min-width: auto;
        width: 100%;
        align-items: stretch;
    }

    .tcd-quantity-selector {
        width: 100%;
        justify-content: space-between;
    }
}

.tcd-modal-content .gform_wrapper .instruction {
    display: none;
}

/* ============================================
   CART INTEGRATION STYLES
   ============================================ */

/* Get in Touch button in cart */
.tcd-cart-group-btn {
    display: inline-block;
    margin-top: 12px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
    text-align: center;
    width: 100%;
    max-width: 200px;
}

.tcd-cart-group-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
    transform: translateY(-1px);
    color: #ffffff !important;
}

.tcd-cart-group-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

/* WooCommerce Blocks - position button below quantity selector */
.wc-block-cart-items__row .tcd-cart-group-btn,
.wc-block-components-order-summary-item .tcd-cart-group-btn {
    margin-top: 12px;
    width: 100%;
}

/* Classic WooCommerce - position button in quantity cell */
.cart_item .tcd-cart-group-btn,
.woocommerce-cart-form__cart-item .tcd-cart-group-btn {
    margin-top: 10px;
    display: block;
}

/* Disabled checkout button */
.tcd-checkout-disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    background: #9ca3af !important;
}

/* WooCommerce Blocks checkout button when disabled */
.wc-block-cart__submit-button.tcd-checkout-disabled,
.wc-block-components-checkout-place-order-button.tcd-checkout-disabled {
    background-color: #9ca3af !important;
    border-color: #9ca3af !important;
}

/* Classic WooCommerce checkout button when disabled */
.checkout-button.tcd-checkout-disabled,
a.checkout-button.tcd-checkout-disabled {
    background-color: #9ca3af !important;
    border-color: #9ca3af !important;
    opacity: 0.6 !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .tcd-cart-group-btn {
        max-width: 100%;
        font-size: 13px;
        padding: 8px 16px;
    }
}