/**
 * Elementor Pricing Switcher Frontend Styles
 *
 * @since 1.0.0
 */

/* ==========================================================================
   Main Container
   ========================================================================== */

.eps-pricing-switcher {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

.eps-pricing-switcher * {
    box-sizing: border-box;
}

/* ==========================================================================
   Switcher Container
   ========================================================================== */

.eps-switcher-container {
    text-align: center;
    margin-bottom: 30px;
}

.eps-switcher {
    display: inline-flex;
    align-items: center;
    gap: 20px;
    background: #f8f9fa;
    padding: 8px 15px;
    border-radius: 50px;
    border: 1px solid #e9ecef;
    position: relative;
}

/* ==========================================================================
   Switch Labels
   ========================================================================== */

.eps-switch-label {
    font-size: 16px;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 25px;
    transition: all 0.3s ease;
    user-select: none;
    white-space: nowrap;
    position: relative;
}

.eps-switch-label:hover {
    color: #495057;
}

.eps-switch-label.active {
    color: #007cba;
    font-weight: 600;
}

/* ==========================================================================
   Switch Wrapper & Toggle
   ========================================================================== */

.eps-switch-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.eps-switch {
    position: relative;
    width: 60px;
    height: 30px;
    background: #dee2e6;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    border: 2px solid transparent;
}

.eps-switch:focus {
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

.eps-switch.monthly {
    background: #007cba;
}

.eps-switch.annual {
    background: #28a745;
}

.eps-switch-slider {
    position: absolute;
    top: 1px;
    left: 3px;
    width: 24px;
    height: 24px;
    background: #ffffff;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.eps-switch.annual .eps-switch-slider {
    transform: translateX(27px);
}

.eps-switch.eps-animating .eps-switch-slider {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Discount Badge
   ========================================================================== */

.eps-discount-badge {
    position: absolute;
    top: -30px;
    left: 0;
    background: #dc3545;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
    animation: eps-badge-bounce 2s infinite;
}

.eps-discount-badge::before {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid #dc3545;
}

@keyframes eps-badge-bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-3px);
    }

    60% {
        transform: translateY(-1px);
    }
}

/* ==========================================================================
   Templates Container
   ========================================================================== */

.eps-templates-container {
    position: relative;
    width: 100%;
    min-height: 200px;
}

.eps-template {
    width: 100%;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    position: absolute;
    top: 0;
    left: 0;
}

.eps-template.active {
    opacity: 1;
    visibility: visible;
    position: relative;
}

.eps-template-placeholder {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    padding: 40px 20px;
    text-align: center;
    color: #6c757d;
    font-size: 16px;
    border-radius: 8px;
}

/* ==========================================================================
   Error State
   ========================================================================== */

.eps-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 10px 0;
    text-align: center;
}

/* ==========================================================================
   Editor Mode
   ========================================================================== */

.eps-editor-mode .eps-template {
    opacity: 1;
    visibility: visible;
    position: relative;
    margin-bottom: 20px;
    border: 2px solid #007cba;
    border-radius: 4px;
    padding: 10px;
}

.eps-editor-mode .eps-template::before {
    content: attr(data-template) ' Template';
    display: block;
    background: #007cba;
    color: white;
    padding: 5px 10px;
    margin: -10px -10px 10px -10px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.eps-editor-notice {
    background: #e7f3ff;
    border: 1px solid #b8daff;
    color: #004085;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 13px;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .eps-switcher {
        gap: 15px;
        padding: 6px 12px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .eps-switch-label {
        font-size: 14px;
        padding: 6px 10px;
    }

    .eps-switch {
        width: 50px;
        height: 26px;
        border-radius: 13px;
    }

    .eps-switch-slider {
        width: 20px;
        height: 20px;
        top: 1px;
        left: 1px;
    }

    .eps-switch.annual .eps-switch-slider {
        transform: translateX(24px);
    }

    .eps-discount-badge {
        font-size: 11px;
        padding: 3px 6px;
        top: -25px;
        left: 0;
        transform: translateX(-50%);
    }
}

/* ==========================================================================
   RTL Support
   ========================================================================== */

.rtl .eps-switch-slider {
    left: auto;
    right: 3px;
}

.rtl .eps-switch.annual .eps-switch-slider {
    transform: translateX(-30px);
}

.rtl .eps-discount-badge {
    left: 50%;
    transform: translateX(-50%);
}

.rtl .eps-discount-badge::before {
    left: 50%;
    transform: translateX(-50%);
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.eps-switch:focus-visible {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {

    .eps-switch,
    .eps-switch-slider,
    .eps-template,
    .eps-switch-label {
        transition: none;
    }

    .eps-discount-badge {
        animation: none;
    }
}

/* ==========================================================================
   High Contrast Mode
   ========================================================================== */

@media (prefers-contrast: high) {
    .eps-switch {
        border: 2px solid currentColor;
    }

    .eps-switch-label {
        border: 1px solid transparent;
    }

    .eps-switch-label.active {
        border-color: currentColor;
    }
}

/* ==========================================================================
   Dark Mode Support
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .eps-switcher {
        background: #2d3748;
        border-color: #4a5568;
    }

    .eps-switch-label {
        color: #a0aec0;
    }

    .eps-switch-label:hover {
        color: #e2e8f0;
    }

    .eps-switch-label.active {
        color: #63b3ed;
    }

    .eps-switch {
        background: #4a5568;
    }

    .eps-template-placeholder {
        background: #2d3748;
        border-color: #4a5568;
        color: #a0aec0;
    }
}