/**
 * Qatar eVisa Checker Styles
 * 
 * @package Qatar_eVisa_Checker
 */

/* ==========================================================================
   Base Styles
   ========================================================================== */

.qatar-visa-checker-container {
    max-width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
}

.qatar-visa-checker-shortcode {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
}

.qatar-visa-checker-title {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.5em;
    color: #333;
    text-align: center;
}

/* ==========================================================================
   Form Styles
   ========================================================================== */

.qatar-visa-form {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.country-selection {
    margin-bottom: 20px;
}

.country-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.country-dropdown-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
}

.qatar-country-select {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    background-color: #fff;
    transition: border-color 0.3s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    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 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 8px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

.qatar-country-select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.qatar-country-select:hover {
    border-color: #999;
}

.country-flag-display {
    min-width: 24px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.selected-country-flag {
    width: 24px;
    height: 18px;
    border: 1px solid #ddd;
    border-radius: 2px;
    object-fit: cover;
}

/* ==========================================================================
   Results Styles
   ========================================================================== */

.visa-results {
    margin-top: 20px;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.visa-status-result {
    padding: 20px;
   }

.visa-status-eligible {
   }

.visa-status-visa_free {
    border-left-color: #00a0d2;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}

.visa-status-not_eligible {
    border-left-color: #dc3232;
    background: linear-gradient(135deg, #fef7f7 0%, #fee2e2 100%);
}

.visa-status-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.visa-status-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.visa-status-icon::before {
    content: "";
    font-family: dashicons;
    font-size: 16px;
    line-height: 1;
}

.visa-icon-eligible {
    background: #46b450;
    color: #fff;
}

.visa-icon-eligible::before {
    content: "✓";
}

.visa-icon-free {
    background: #00a0d2;
    color: #fff;
}

.visa-icon-free::before {
    content: "★";
}

.visa-icon-not-eligible {
    background: #dc3232;
    color: #fff;
}

.visa-icon-not-eligible::before {
    content: "✗";
}

.visa-status-title {
    margin: 0;
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
}

.visa-status-message {
    margin-bottom: 20px;
}

.visa-status-message p {
    margin: 0 0 15px 0;
    color: #555;
    line-height: 1.6;
}

/* ==========================================================================
   Requirements Styles
   ========================================================================== */

.visa-requirements {
    background: rgba(255, 255, 255, 0.8);
    padding: 15px;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    margin-top: 15px;
}

.visa-requirements h5 {
    margin: 0 0 10px 0;
    font-size: 1em;
    font-weight: 600;
    color: #333;
}

.requirements-list {
    margin: 0;
    padding-left: 20px;
    list-style-type: disc;
}

.requirements-list li {
    margin-bottom: 8px;
    color: #555;
    line-height: 1.5;
}

/* ==========================================================================
   Apply Button Styles
   ========================================================================== */

.visa-apply-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.apply-info {
    margin: 0 0 15px 0;
    color: #555;
    font-weight: 500;
}

.qatar-apply-button {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 2px 4px rgba(0, 115, 170, 0.3);
}

.qatar-apply-button:hover {
    background: linear-gradient(135deg, #005a87 0%, #0073aa 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 115, 170, 0.4);
    color: #fff;
    text-decoration: none;
}

.qatar-apply-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 115, 170, 0.3);
}

/* ==========================================================================
   Visa Free Info Styles
   ========================================================================== */

.visa-free-info {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.visa-free-notice {
    background: rgba(0, 160, 210, 0.1);
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #00a0d2;
}

.visa-free-notice strong {
    color: #00a0d2;
    display: block;
    margin-bottom: 8px;
}

.visa-free-notice p {
    margin: 0;
    color: #555;
    line-height: 1.5;
}

/* ==========================================================================
   Footer Styles
   ========================================================================== */

.visa-info-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.disclaimer {
    margin: 0;
    text-align: center;
}

.disclaimer small {
    color: #777;
    font-style: italic;
    line-height: 1.4;
}

/* ==========================================================================
   Loading Styles
   ========================================================================== */

.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    margin-top: 15px;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #666;
    font-size: 14px;
}

/* ==========================================================================
   Widget Specific Styles
   ========================================================================== */

.widget .qatar-visa-checker-container {
    margin: 0;
    overflow: visible;
}

.widget .qatar-visa-form {
    box-shadow: none;
    border: 1px solid #e1e1e1;
    padding: 15px;
    overflow: visible;
}

.widget .qatar-country-select {
    font-size: 14px;
    padding: 10px;
}

.widget .visa-status-title {
    font-size: 1.1em;
}

.widget .country-dropdown-wrapper {
    z-index: 9999;
    overflow: visible;
}

.widget .country-options-container {
    z-index: 9999;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
}

/* Ensure widget containers don't clip dropdown */
.widget,
.widget_text,
.textwidget {
    overflow: visible !important;
}

/* Additional widget overflow fixes */
.widget .qatar-visa-checker-container,
.widget .qatar-visa-form,
.widget .country-selection {
    overflow: visible !important;
}

/* Add bottom margin to widget to accommodate dropdown */
.widget .qatar-visa-checker-container {
    margin-bottom: 300px !important;
    min-height: 350px !important;
    padding-bottom: 50px !important;
}

/* Ensure dropdown has proper positioning */
.widget .qatar-country-select {
    position: relative;
    z-index: 99999 !important;
}

/* Widget specific dropdown positioning */
.widget .country-dropdown-wrapper {
    position: relative;
    z-index: 99999 !important;
    overflow: visible !important;
}

/* Ensure dropdown list appears correctly in widgets */
.widget .qatar-country-select option {
    padding: 8px 12px;
    background: white;
    color: #333;
}

/* Force WordPress widget areas to show dropdown */
.widget-area,
.sidebar,
#sidebar,
.sidebar-widget,
.sidebar-content,
.widget-wrap,
.widget-container,
.wp-block-widget-area {
    overflow: visible !important;
    z-index: 1 !important;
    position: static !important;
}

/* Target all potential WordPress widget containers */
div[class*="widget"],
section[class*="widget"],
aside[class*="widget"],
.widget_custom_html,
.widget_text,
.textwidget,
.widget-inner,
.widget-content {
    overflow: visible !important;
    position: static !important;
}

/* Make select dropdown size bigger in widgets to show more options */
.widget .qatar-country-select {
    size: 8 !important;
    height: auto !important;
    padding: 8px !important;
}

/* Ensure dropdown options are visible */
.widget .qatar-country-select option {
    display: block !important;
    visibility: visible !important;
    padding: 6px 10px !important;
    background: white !important;
    color: #333 !important;
    border: none !important;
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */

@media (max-width: 768px) {
    .qatar-visa-checker-shortcode {
        padding: 15px;
        margin: 15px 0;
    }
    
    .qatar-visa-form {
        padding: 15px;
    }
    
    .country-dropdown-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .country-flag-display {
        align-self: flex-start;
        min-width: auto;
    }
    
    .qatar-country-select {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .visa-status-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .visa-status-icon {
        align-self: flex-start;
    }
    
    .qatar-apply-button {
        display: block;
        text-align: center;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .qatar-visa-checker-title {
        font-size: 1.3em;
    }
    
    .visa-status-title {
        font-size: 1.1em;
    }
    
    .requirements-list {
        padding-left: 15px;
    }
}

/* ==========================================================================
   High Contrast Support
   ========================================================================== */

@media (prefers-contrast: high) {
    .qatar-country-select {
        border-width: 2px;
        border-color: #000;
    }
    
    .visa-status-result {
        border-width: 2px;
    }
    
    .qatar-apply-button {
        border: 2px solid #000;
    }
}

/* ==========================================================================
   Reduced Motion Support
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .visa-results,
    .loading-spinner,
    .qatar-apply-button {
        animation: none;
        transition: none;
    }
    
    .qatar-apply-button:hover {
        transform: none;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .qatar-visa-checker-container {
        background: #fff !important;
        box-shadow: none !important;
    }
    
    .qatar-apply-button {
        background: #fff !important;
        color: #000 !important;
        border: 1px solid #000 !important;
    }
    
    .loading-indicator {
        display: none !important;
    }
}