/* IMG Elementor Widgets Frontend Styles */

/* Global Variables */
:root {
    --img-primary: #667eea;
    --img-secondary: #764ba2;
    --img-success: #27ae60;
    --img-warning: #f39c12;
    --img-danger: #e74c3c;
    --img-dark: #2c3e50;
    --img-light: #ecf0f1;
    --img-border-radius: 10px;
    --img-box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    --img-transition: all 0.3s ease;
}

/* General Widget Styles */
.img-widget {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-sizing: border-box;
}

.img-widget *,
.img-widget *::before,
.img-widget *::after {
    box-sizing: inherit;
}

/* Button Styles */
.img-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--img-border-radius);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--img-transition);
    font-size: 14px;
    line-height: 1.4;
}

.img-btn-primary {
    background: linear-gradient(135deg, var(--img-primary) 0%, var(--img-secondary) 100%);
    color: white;
}

.img-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.img-btn-secondary {
    background: transparent;
    color: var(--img-primary);
    border: 2px solid var(--img-primary);
}

.img-btn-secondary:hover {
    background: var(--img-primary);
    color: white;
}

/* Card Styles */
.img-card {
    background: white;
    border-radius: var(--img-border-radius);
    padding: 25px;
    box-shadow: var(--img-box-shadow);
    transition: var(--img-transition);
    position: relative;
    overflow: hidden;
}

.img-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.img-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--img-primary), var(--img-secondary));
}

/* Badge Styles */
.img-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.img-badge-primary {
    background: var(--img-primary);
    color: white;
}

.img-badge-success {
    background: var(--img-success);
    color: white;
}

.img-badge-warning {
    background: var(--img-warning);
    color: white;
}

.img-badge-danger {
    background: var(--img-danger);
    color: white;
}

/* Form Styles */
.img-form-group {
    margin-bottom: 20px;
}

.img-form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--img-dark);
}

.img-form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: var(--img-border-radius);
    font-size: 14px;
    transition: var(--img-transition);
    background: white;
}

.img-form-control:focus {
    outline: none;
    border-color: var(--img-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.img-form-control::placeholder {
    color: #6c757d;
}

/* Select Styles */
.img-select {
    position: relative;
}

.img-select select {
    appearance: none;
    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='%236b7280' 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: 16px;
    padding-right: 40px;
}

/* Checkbox Styles */
.img-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    cursor: pointer;
}

.img-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--img-primary);
}

.img-checkbox-label {
    font-size: 14px;
    color: var(--img-dark);
    user-select: none;
}

/* Range Slider Styles */
.img-range-slider {
    position: relative;
    margin: 20px 0;
}

.img-range-input {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e9ecef;
    outline: none;
    -webkit-appearance: none;
}

.img-range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--img-primary);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.img-range-input::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--img-primary);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.img-range-values {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: #6c757d;
}

/* Grid System */
.img-grid {
    display: grid;
    gap: 20px;
}

.img-grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.img-grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.img-grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Loading Spinner */
.img-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--img-primary);
}

.img-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e9ecef;
    border-top: 4px solid var(--img-primary);
    border-radius: 50%;
    animation: img-spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes img-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Animations */
.img-fade-in {
    animation: img-fadeIn 0.5s ease-in;
}

@keyframes img-fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.img-slide-in-left {
    animation: img-slideInLeft 0.5s ease-out;
}

@keyframes img-slideInLeft {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

.img-scale-in {
    animation: img-scaleIn 0.3s ease-out;
}

@keyframes img-scaleIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Score Indicators */
.img-score {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

.img-score-excellent {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.img-score-very-good {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
}

.img-score-good {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
}

.img-score-fair {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    color: white;
}

.img-score-poor {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

/* Visa Badges */
.img-visa-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.img-visa-j1 {
    background: #3498db;
    color: white;
}

.img-visa-h1b {
    background: #e74c3c;
    color: white;
}

.img-visa-o1 {
    background: #f39c12;
    color: white;
}

/* Requirement Status Icons */
.img-requirement-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
}

.img-status-required {
    background: var(--img-danger);
    color: white;
}

.img-status-optional {
    background: var(--img-warning);
    color: white;
}

.img-status-flexible {
    background: var(--img-success);
    color: white;
}

/* Tooltips */
.img-tooltip {
    position: relative;
    cursor: help;
}

.img-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--img-dark);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--img-transition);
    z-index: 1000;
}

.img-tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Progress Bars */
.img-progress {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.img-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--img-primary), var(--img-secondary));
    border-radius: 4px;
    transition: width 1s ease-out;
    position: relative;
}

.img-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: img-progressShine 2s infinite;
}

@keyframes img-progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Modal Styles */
.img-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: var(--img-transition);
}

.img-modal.active {
    opacity: 1;
    visibility: visible;
}

.img-modal-content {
    background: white;
    border-radius: var(--img-border-radius);
    padding: 30px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.8);
    transition: var(--img-transition);
}

.img-modal.active .img-modal-content {
    transform: scale(1);
}

.img-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    transition: var(--img-transition);
}

.img-modal-close:hover {
    color: var(--img-danger);
}

/* Responsive Design */
@media (max-width: 768px) {
    .img-grid-2,
    .img-grid-3,
    .img-grid-4 {
        grid-template-columns: 1fr;
    }
    
    .img-card {
        padding: 20px;
    }
    
    .img-btn {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .img-modal-content {
        padding: 20px;
        margin: 20px;
    }
}

@media (max-width: 480px) {
    .img-card {
        padding: 15px;
    }
    
    .img-btn {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .img-form-control {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* Print Styles */
@media print {
    .img-btn,
    .img-modal,
    .img-loading {
        display: none !important;
    }
    
    .img-card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
    
    .img-score,
    .img-badge {
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .img-card {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .img-form-control {
        background: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .img-form-control::placeholder {
        color: #a0aec0;
    }
    
    .img-form-label {
        color: #e2e8f0;
    }
}

/* Accessibility */
.img-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.img-widget:focus-visible {
    outline: 2px solid var(--img-primary);
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .img-card {
        border: 2px solid;
    }
    
    .img-btn {
        border: 2px solid;
    }
    
    .img-form-control {
        border-width: 3px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .img-card,
    .img-btn,
    .img-form-control,
    .img-modal,
    .img-modal-content,
    .img-progress-bar {
        transition: none;
    }
    
    .img-spinner,
    .img-progress-bar::after {
        animation: none;
    }
}