/* Frontend Styles for Tutor Installments */

/* Product Page Installment Options */
.tutor-installments-options {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.tutor-installments-options h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
}

.installment-option {
    margin-bottom: 15px;
    padding: 15px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.installment-option:hover {
    border-color: #999;
}

.installment-option label {
    display: block;
    cursor: pointer;
    margin: 0;
}

.installment-option input[type="radio"] {
    margin-right: 10px;
    vertical-align: middle;
}

.installment-option input[type="radio"]:checked + span {
    font-weight: 600;
}

.installment-option.selected {
    border-color: #0073aa;
    background: #f0f8ff;
}

.installment-details {
    margin-top: 10px;
    padding-left: 30px;
    display: none;
}

.installment-option input[type="radio"]:checked ~ .installment-details {
    display: block;
}

.installment-details p {
    margin: 5px 0;
    font-size: 14px;
}

.installment-note {
    color: #46b450;
    font-style: italic;
    margin-top: 10px !important;
}

/* Course Suspension Notice */
.tutor-installment-suspension-notice {
    margin: 20px 0;
    padding: 20px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 5px;
}

.tutor-installment-suspension-notice h3 {
    color: #856404;
    margin-top: 0;
}

.tutor-installment-suspension-notice p {
    color: #856404;
    margin: 10px 0;
}

.tutor-installment-suspension-notice .tutor-btn {
    margin-top: 10px;
}

/* ============================================
   INSTALLMENTS BADGE STYLES
   ============================================ */

/* Badge Container */
.tutor-installments-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    background: #2196F3;
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    pointer-events: none;
    transition: all 0.3s ease;
}

/* Badge Text */
.tutor-installments-badge-text {
    display: block;
    white-space: nowrap;
}

/* Hover Effect for Badge */
.tutor-course-loop-header:hover .tutor-installments-badge,
.tutor-single-course-thumbnail:hover .tutor-installments-badge {
    transform: scale(1.05);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

/* Wrapper for Thumbnail with Badge */
.tutor-course-thumbnail-wrapper {
    position: relative;
    display: block;
    overflow: hidden;
}

/* Ensure parent containers have position relative */
.tutor-course-thumbnail,
.tutor-course-loop-thumbnail,
.tutor-single-course-thumbnail,
.tutor-course-header,
.tutor-course-loop-header {
    position: relative;
}

/* Badge Positioning Variants */
/* Top Left (Default) */
.tutor-installments-badge.badge-position-top-left {
    top: 10px;
    left: 10px;
    right: auto;
}

/* Top Right */
.tutor-installments-badge.badge-position-top-right {
    top: 10px;
    right: 10px;
    left: auto;
}

/* Bottom Right */
.tutor-installments-badge.badge-position-bottom-right {
    bottom: 10px;
    top: auto;
    right: 10px;
}

/* Bottom Left */
.tutor-installments-badge.badge-position-bottom-left {
    bottom: 10px;
    top: auto;
    left: 10px;
    right: auto;
}

/* Badge Color Variants */
.tutor-installments-badge.badge-blue {
    background: #2196F3;
}

.tutor-installments-badge.badge-green {
    background: #4CAF50;
}

.tutor-installments-badge.badge-orange {
    background: #FF9800;
}

.tutor-installments-badge.badge-red {
    background: #F44336;
}

.tutor-installments-badge.badge-purple {
    background: #9C27B0;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .tutor-installments-badge {
        box-shadow: 0 2px 4px rgba(255, 255, 255, 0.1);
    }
}

/* Accessibility: High Contrast Mode */
@media (prefers-contrast: high) {
    .tutor-installments-badge {
        border: 2px solid #ffffff;
        font-weight: 700;
    }
}

/* Print Styles */
@media print {
    .tutor-installments-badge {
        position: static;
        display: inline-block;
        margin: 10px 0;
        box-shadow: none;
    }
}

/* Course Archive/Grid Specific Adjustments */
.tutor-courses-loop .tutor-installments-badge {
    font-size: 11px;
    padding: 5px 10px;
}

/* Course Single Page Specific Adjustments */
.tutor-single-course .tutor-installments-badge {
    font-size: 13px;
    padding: 7px 14px;
}

/* Widget Areas */
.widget .tutor-installments-badge {
    font-size: 10px;
    padding: 4px 8px;
    top: 5px;
    right: 5px;
}

/* Shortcode Displays */
.tutor-shortcode-courses .tutor-installments-badge {
    font-size: 11px;
    padding: 5px 10px;
}

/* RTL Support */
html[dir="rtl"] .tutor-installments-badge {
    right: auto;
    left: 10px;
}

html[dir="rtl"] .tutor-installments-badge.badge-position-top-right {
    left: 10px;
    right: auto;
}

html[dir="rtl"] .tutor-installments-badge.badge-position-top-left {
    left: auto;
    right: 10px;
}

html[dir="rtl"] .tutor-installments-badge.badge-position-bottom-right {
    left: 10px;
    right: auto;
}

html[dir="rtl"] .tutor-installments-badge.badge-position-bottom-left {
    left: auto;
    right: 10px;
}

/* Animation for Badge Entrance */
@keyframes badgeFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.tutor-installments-badge {
    animation: badgeFadeIn 0.4s ease-out;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .tutor-installments-badge {
        font-size: 11px;
        padding: 5px 10px;
    }
}

@media (max-width: 768px) {
    .tutor-installments-options {
        padding: 15px;
    }
    
    .installment-option {
        padding: 12px;
    }
    
    .installment-details {
        padding-left: 20px;
    }
    
    /* Badge adjustments for mobile */
    .tutor-installments-badge {
        font-size: 10px;
        padding: 4px 8px;
        top: 8px;
        right: 8px;
        letter-spacing: 0.3px;
    }
    
    .tutor-single-course .tutor-installments-badge {
        font-size: 11px;
        padding: 5px 10px;
    }
}

@media (max-width: 480px) {
    .tutor-installments-badge {
        font-size: 9px;
        padding: 3px 6px;
        top: 5px;
        right: 5px;
        border-radius: 3px;
    }
    
    .tutor-installments-badge-text {
        letter-spacing: 0.2px;
    }
}

/* Tablet Specific */
@media (min-width: 768px) and (max-width: 1024px) {
    .tutor-courses-loop .tutor-installments-badge {
        font-size: 10px;
        padding: 4px 9px;
    }
}

/* Large Screens */
@media (min-width: 1440px) {
    .tutor-single-course .tutor-installments-badge {
        font-size: 14px;
        padding: 8px 16px;
    }
}

/* Fix for themes that might conflict */
.tutor-course-loop-header-meta .tutor-installments-badge,
.tutor-course-thumbnail .tutor-installments-badge {
    margin: 0 !important;
    float: none !important;
}

/* Ensure badge stays visible on image hover effects */
.tutor-course-thumbnail img {
    transition: transform 0.3s ease;
}

.tutor-course-thumbnail:hover img {
    transform: scale(1.05);
}

.tutor-course-thumbnail:hover .tutor-installments-badge {
    z-index: 11;
}

/* Compatibility with popular themes */
.elementor-widget-container .tutor-installments-badge,
.vc_column-inner .tutor-installments-badge {
    position: absolute;
    top: 10px;
    right: 10px;
}

/* Ensure badge doesn't overlap with other badges/ribbons */
.tutor-course-difficulty-level + .tutor-installments-badge {
    top: 40px;
}

/* Loading state */
.tutor-installments-badge.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Focus state for accessibility (if badge becomes interactive in future) */
.tutor-installments-badge:focus {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}