/**
 * RTL Frontend Styles for Course Code Manager
 */

/* Basic RTL layout */
.rtl .ccm-code-container {
    direction: rtl;
    text-align: right;
    font-family: 'Tahoma', 'Arial', sans-serif;
}

.rtl .ccm-code-input-title {
    text-align: right;
    direction: rtl;
}

.rtl .ccm-code-input-description {
    text-align: right;
    direction: rtl;
}

/* Form styling */
.rtl .ccm-code-form {
    direction: rtl;
}

.rtl .ccm-input-group {
    direction: rtl;
}

.rtl .ccm-input-label {
    text-align: right;
    direction: rtl;
}

.rtl .ccm-input-wrapper {
    direction: rtl;
    display: flex;
    flex-direction: row-reverse; /* Reverse flex direction for RTL */
}

/* Input field */
.rtl .ccm-code-input {
    text-align: center; /* Keep code input centered for better UX */
    direction: ltr; /* Keep code input LTR for consistency */
    font-family: 'Courier New', monospace;
    border-radius: 4px 0 0 4px; /* Adjust border radius for RTL */
}

/* Button styling */
.rtl .ccm-redeem-button {
    border-radius: 0 4px 4px 0; /* Adjust border radius for RTL */
}

.rtl .ccm-button-text,
.rtl .ccm-button-loading {
    direction: rtl;
}

.rtl .ccm-spinner {
    margin-left: 5px;
    margin-right: 0;
}

/* Message container */
.rtl .ccm-message-container {
    direction: rtl;
    text-align: right;
}

.rtl .ccm-message {
    text-align: right;
    direction: rtl;
}

.rtl .ccm-message.success {
    text-align: right;
}

.rtl .ccm-message.error {
    text-align: right;
}

/* Help text */
.rtl .ccm-code-info {
    direction: rtl;
    text-align: right;
}

.rtl .ccm-code-help {
    text-align: right;
    direction: rtl;
}

/* Injected form styles */
.rtl .ccm-injected-form {
    direction: rtl;
}

.rtl .ccm-injected-form .ccm-code-container {
    text-align: right;
}

.rtl .ccm-course-code-section {
    direction: rtl;
    text-align: right;
}

/* Responsive design for RTL */
@media (max-width: 768px) {
    .rtl .ccm-input-wrapper {
        flex-direction: column;
    }
    
    .rtl .ccm-code-input {
        border-radius: 4px 4px 0 0;
        margin-bottom: 10px;
    }
    
    .rtl .ccm-redeem-button {
        border-radius: 0 0 4px 4px;
        width: 100%;
    }
}

/* Loading state */
.rtl .ccm-code-form.loading {
    opacity: 0.7;
}

.rtl .ccm-code-form.loading .ccm-code-input {
    direction: ltr; /* Keep input LTR during loading */
}

/* Success/Error states */
.rtl .ccm-code-input.success {
    border-color: #46b450;
}

.rtl .ccm-code-input.error {
    border-color: #dc3232;
}

/* Accessibility improvements for RTL */
.rtl .ccm-code-input:focus {
    outline-offset: 2px;
    direction: ltr; /* Keep focused input LTR */
}

/* Placeholder text */
.rtl .ccm-code-input::placeholder {
    text-align: center;
    direction: ltr; /* Keep placeholder LTR for better UX */
}

/* Animation adjustments for RTL */
.rtl .ccm-message.slide-in {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Course enrollment button adjustments */
.rtl .ccm-enroll-button {
    direction: rtl;
    text-align: center;
}

/* Code formatting for display */
.rtl .ccm-code-display {
    direction: ltr; /* Keep code display LTR */
    text-align: center;
    font-family: 'Courier New', monospace;
}

/* Integration with common themes */
.rtl .course-entry-box .ccm-code-container,
.rtl .tutor-course-enrollment-box .ccm-code-container {
    direction: rtl;
    text-align: right;
}

/* WooCommerce integration */
.rtl .woocommerce .ccm-code-container {
    direction: rtl;
    text-align: right;
}

/* Tutor LMS specific adjustments */
.rtl .tutor-single-course-sidebar .ccm-code-container {
    direction: rtl;
}

.rtl .tutor-course-details-actions .ccm-code-container {
    direction: rtl;
    text-align: right;
}

/* Progress indicators */
.rtl .ccm-progress-indicator {
    direction: rtl;
}

.rtl .ccm-progress-bar {
    direction: ltr; /* Keep progress bar LTR */
}

.rtl .ccm-progress-text {
    text-align: right;
    direction: rtl;
}

/* Tooltip adjustments */
.rtl .ccm-tooltip {
    direction: rtl;
    text-align: right;
}

/* Print styles for RTL */
@media print {
    .rtl .ccm-code-container {
        direction: rtl;
        text-align: right;
    }
    
    .rtl .ccm-code-display {
        direction: ltr;
        text-align: center;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .rtl .ccm-code-input {
        border-width: 2px;
    }
    
    .rtl .ccm-redeem-button {
        border-width: 2px;
    }
} 