/**
 * TFS Site Manager - Professional Subscription Selector
 *
 * Clean, minimal design inspired by modern SaaS platforms.
 * Light theme with proper alignment and professional styling.
 *
 * @package TFS\SiteManager
 * @version 2.1.0
 */

/* ==========================================================================
   Subscription Selector - Main Container
   ========================================================================== */

.tfs-subscription-selector {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border-default);
    border-radius: 8px;
    padding: 24px;
    margin: 24px 0;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.tfs-subscription-selector h4 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text-strong);
    letter-spacing: -0.01em;
}

/* ==========================================================================
   Section Labels
   ========================================================================== */

.tfs-billing-cycle-group > label:first-child,
.tfs-plan-select-wrapper > label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ==========================================================================
   Billing Cycle Toggle - Clean Pill Style
   ========================================================================== */

.tfs-billing-cycle-group {
    margin-bottom: 20px;
}

.tfs-cycle-options {
    display: inline-flex;
    gap: 8px;
}

.tfs-cycle-radio-wrapper {
    position: relative;
}

.tfs-cycle-radio-wrapper input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.tfs-cycle-radio-wrapper label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-muted);
    background: var(--color-bg-surface-muted);
    border: 1px solid var(--color-border-default);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.tfs-cycle-radio-wrapper input[type="radio"]:checked + label {
    background: var(--color-action-primary);
    color: var(--color-text-inverse);
    border-color: var(--color-action-primary);
}

.tfs-cycle-radio-wrapper label:hover {
    border-color: var(--color-border-strong);
}

.tfs-cycle-radio-wrapper input[type="radio"]:checked + label:hover {
    background: var(--color-action-primary-hover);
    border-color: var(--color-action-primary-hover);
}

/* Savings Badge */
.tfs-cycle-savings-badge {
    display: inline-block;
    padding: 2px 6px;
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.tfs-cycle-radio-wrapper input[type="radio"]:checked + label .tfs-cycle-savings-badge {
    background: rgba(255, 255, 255, 0.25);
    color: var(--color-text-inverse);
}

/* ==========================================================================
   Plan Dropdown Selector
   ========================================================================== */

.tfs-plan-select-wrapper {
    margin-bottom: 16px;
}

.tfs-plan-select-wrapper select {
    width: 100%;
    height: 48px;
    padding: 0 40px 0 14px;
    font-size: 15px;
    font-weight: 400;
    color: var(--color-text-strong);
    background-color: var(--color-bg-surface);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 20px 20px;
    border: 1px solid var(--color-border-strong);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.tfs-plan-select-wrapper select:hover {
    border-color: var(--color-text-subtle);
}

.tfs-plan-select-wrapper select:focus {
    outline: none;
    border-color: var(--color-action-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.tfs-plan-select-wrapper select option {
    padding: 12px;
}

/* ==========================================================================
   Plan Description / Features
   ========================================================================== */

.tfs-plan-description-card {
    padding: 0;
    background: transparent;
    border: none;
    margin-top: 16px;
}

.tfs-plan-description-card p {
    margin: 0 0 8px 0;
    color: var(--color-text-muted);
    font-size: 14px;
    line-height: 1.6;
}

/* Plan features list */
.tfs-plan-description-card ul,
.tfs-plan-features {
    list-style: none;
    padding: 0;
    margin: 12px 0 0 0;
}

.tfs-plan-description-card li,
.tfs-plan-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--color-text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.tfs-plan-description-card li:last-child,
.tfs-plan-feature-item:last-child {
    margin-bottom: 0;
}

.tfs-plan-description-card li::before,
.tfs-plan-feature-item::before {
    content: "✓";
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ref-success-500);
    color: white;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 600;
    margin-top: 1px;
}

/* ==========================================================================
   Hidden Fields & Quantity
   ========================================================================== */

.tfs-subscription-selector input[type="hidden"] {
    display: none;
}

/* Hide quantity field for subscription products */
.single-product .product .quantity,
.tfs-quantity-hidden {
    display: none !important;
}

/* ==========================================================================
   Product Title Positioning
   ========================================================================== */

/* Move product title to left side above image */
.single-product div.product .product_title {
    order: -10;
    width: 100%;
    text-align: left;
    margin-bottom: 20px;
}

/* ==========================================================================
   Buttons - Inline with Consistent Styling
   ========================================================================== */

/* Wrapper for form container */
.tfs-buttons-wrapper {
    margin: 24px 0 !important;
}

/* Form inside wrapper - normal display */
.tfs-buttons-wrapper form.cart {
    display: block !important;
    margin: 0 !important;
    width: 100% !important;
}

/* Buttons inside form - display inline with gap */
.tfs-buttons-wrapper form.cart .button,
.tfs-buttons-wrapper form.cart button,
.single-product .product form.cart .button,
.single-product .product form.cart button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 12px 0 0 !important;
    vertical-align: middle !important;
}

/* Last button - no right margin */
.tfs-buttons-wrapper form.cart .button:last-child,
.tfs-buttons-wrapper form.cart button:last-child {
    margin-right: 0 !important;
}

/* Consistent button styling for all buttons */
.tfs-buttons-wrapper button,
.tfs-buttons-wrapper a.button,
.tfs-buttons-wrapper .live-demo-btn,
.single-product .product .cart button,
.single-product .product .cart a.button {
    min-height: 48px !important;
    height: 48px !important;
    padding: 12px 24px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    text-decoration: none !important;
    line-height: 1.2 !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08) !important;
}

/* Add to Cart button — primary CTA (filled red) */
.tfs-buttons-wrapper button[type="submit"],
.tfs-buttons-wrapper .single_add_to_cart_button,
.single-product .product .cart button[type="submit"],
.single-product .product .cart .single_add_to_cart_button {
    background: var(--color-action-primary) !important;
    color: var(--color-action-primary-text) !important;
    border: 1px solid var(--color-action-primary) !important;
}

.tfs-buttons-wrapper button[type="submit"]:hover,
.tfs-buttons-wrapper .single_add_to_cart_button:hover,
.single-product .product .cart button[type="submit"]:hover,
.single-product .product .cart .single_add_to_cart_button:hover {
    background: var(--color-action-primary-hover) !important;
    color: var(--color-action-primary-text) !important;
    border-color: var(--color-action-primary-hover) !important;
    box-shadow: 0 10px 22px rgba(var(--bs-primary-rgb), 0.25) !important;
    transform: translateY(-1px);
}

/* Live Demo button — outlined gray (secondary action next to Add to Cart) */
.tfs-buttons-wrapper a.live-demo-btn,
.tfs-buttons-wrapper .live-demo-btn,
.tfs-buttons-wrapper .button.live-demo-btn,
a.live-demo-btn {
    background: transparent !important;
    color: var(--color-action-filled-secondary) !important;
    border: 1px solid var(--color-action-filled-secondary) !important;
}

.tfs-buttons-wrapper a.live-demo-btn:hover,
.tfs-buttons-wrapper .live-demo-btn:hover,
a.live-demo-btn:hover {
    background: var(--color-action-filled-secondary) !important;
    color: var(--color-action-filled-secondary-text) !important;
    box-shadow: 0 10px 22px rgba(31, 41, 55, 0.15) !important;
    transform: translateY(-1px);
}

/* ==========================================================================
   Price Display Override
   ========================================================================== */

.single-product .product.type-product .price {
    display: none !important;
}

/* ==========================================================================
   Responsive Design - Mobile
   ========================================================================== */

@media (max-width: 640px) {
    .tfs-subscription-selector {
        padding: 20px 16px;
        margin: 20px 0;
    }

    .tfs-subscription-selector h4 {
        font-size: 16px;
        margin-bottom: 16px;
    }

    .tfs-billing-cycle-group > label:first-child,
    .tfs-plan-select-wrapper > label {
        font-size: 12px;
    }

    .tfs-cycle-options {
        width: 100%;
        gap: 6px;
    }

    .tfs-cycle-radio-wrapper {
        flex: 1;
    }

    .tfs-cycle-radio-wrapper label {
        width: 100%;
        justify-content: center;
        padding: 10px 12px;
        font-size: 13px;
    }

    .tfs-cycle-savings-badge {
        font-size: 10px;
        padding: 2px 4px;
    }

    .tfs-plan-select-wrapper select {
        height: 44px;
        font-size: 14px;
    }

    .tfs-plan-description-card {
        padding: 12px 14px;
    }

    .tfs-plan-description-card p {
        font-size: 13px;
    }
}

/* ==========================================================================
   Loading State
   ========================================================================== */

.tfs-subscription-selector.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* ==========================================================================
   Focus Visible (Accessibility)
   ========================================================================== */

.tfs-cycle-radio-wrapper input[type="radio"]:focus-visible + label {
    outline: 2px solid var(--color-action-primary);
    outline-offset: 2px;
}

.tfs-plan-select-wrapper select:focus-visible {
    outline: 2px solid var(--color-action-primary);
    outline-offset: 2px;
}
