/* Auto Language Redirect Plugin Styles */

/* Base Modal Styles */
#language-detector-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: none;
}

.language-detector-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
}

.language-detector-content {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

/* Modal Header */
.modal-header {
    padding: 25px 25px 15px;
    border-bottom: 1px solid #e0e0e0;
    position: relative;
}

.modal-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
    text-align: center;
}

.close-button {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    font-weight: 300;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 5px;
    transition: color 0.2s ease;
}

.close-button:hover {
    color: #666;
}

/* Modal Body */
.modal-body {
    padding: 20px 25px;
}

.location-info {
    text-align: center;
    margin-bottom: 15px;
    font-size: 16px;
    color: #555;
}

.welcome-message {
    text-align: center;
    margin-bottom: 25px;
    font-size: 15px;
    line-height: 1.5;
    color: #666;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #0073aa;
}

.welcome-message p {
    margin: 0;
}

/* Language Options */
.language-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin: 20px 0;
}

.language-option {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px 20px;
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    min-height: 60px;
    position: relative;
}

.language-option:hover {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 115, 170, 0.3);
}

.language-option:active {
    transform: translateY(0);
}

.language-option .flag {
    font-size: 24px;
    margin-right: 10px;
}

.language-option .language-name {
    font-weight: 600;
}

/* Suggested Language Styling */
.language-option.suggested {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border-color: #c0392b;
    box-shadow: 0 0 20px rgba(231, 76, 60, 0.4);
    animation: pulse-glow 2s infinite;
}

.language-option.suggested:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(231, 76, 60, 0.4);
    }
    50% {
        box-shadow: 0 0 30px rgba(231, 76, 60, 0.6);
    }
}

/* Modal Footer */
.modal-footer {
    padding: 15px 25px 25px;
    text-align: center;
    border-top: 1px solid #e0e0e0;
}

.continue-button {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.continue-button:hover {
    background: #5a6268;
}

/* Modal Themes */

/* Dark Theme */
.theme-dark .language-detector-content {
    background: #2c3e50;
    color: #ecf0f1;
}

.theme-dark .modal-header {
    border-bottom-color: #34495e;
}

.theme-dark .modal-header h3 {
    color: #ecf0f1;
}

.theme-dark .close-button {
    color: #bdc3c7;
}

.theme-dark .close-button:hover {
    color: #ecf0f1;
}

.theme-dark .location-info {
    color: #bdc3c7;
}

.theme-dark .welcome-message {
    background: #34495e;
    color: #ecf0f1;
    border-left-color: #3498db;
}

.theme-dark .language-option {
    background: #34495e;
    color: #ecf0f1;
    border-color: #4a5f7a;
}

.theme-dark .language-option:hover {
    background: #3498db;
    border-color: #3498db;
}

.theme-dark .modal-footer {
    border-top-color: #34495e;
}

.theme-dark .continue-button {
    background: #7f8c8d;
}

.theme-dark .continue-button:hover {
    background: #95a5a6;
}

/* Minimal Theme */
.theme-minimal .language-detector-content {
    background: #ffffff;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

.theme-minimal .modal-header {
    padding: 20px 20px 10px;
    border-bottom: none;
}

.theme-minimal .modal-header h3 {
    font-size: 20px;
    font-weight: 400;
}

.theme-minimal .modal-body {
    padding: 10px 20px;
}

.theme-minimal .welcome-message {
    background: transparent;
    border: none;
    padding: 10px 0;
    color: #666;
}

.theme-minimal .language-option {
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px 16px;
    min-height: auto;
}

.theme-minimal .language-option:hover {
    background: #f8f9fa;
    border-color: #0073aa;
    color: #0073aa;
    transform: none;
    box-shadow: none;
}

.theme-minimal .modal-footer {
    padding: 10px 20px 20px;
    border-top: none;
}

/* Modal Positions */
.position-center .language-detector-overlay {
    align-items: center;
}

.position-top .language-detector-overlay {
    align-items: flex-start;
    padding-top: 50px;
}

.position-bottom .language-detector-overlay {
    align-items: flex-end;
    padding-bottom: 50px;
}

/* Flag Icons */
.flag {
    display: inline-block;
    font-size: 24px;
    margin-right: 10px;
    line-height: 1;
}

.flag.flag-placeholder {
    width: 24px;
    height: 18px;
    background: #ddd;
    border-radius: 2px;
    margin-right: 10px;
    display: inline-block;
    vertical-align: middle;
}

/* Responsive Design */
@media (max-width: 768px) {
    .language-detector-content {
        margin: 20px;
        width: calc(100% - 40px);
        max-width: none;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .language-options {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .language-option {
        min-height: 50px;
        padding: 12px 16px;
        font-size: 15px;
    }
    
    .modal-header h3 {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .language-detector-content {
        margin: 10px;
        width: calc(100% - 20px);
        border-radius: 8px;
    }
    
    .modal-header {
        padding: 20px 15px 10px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .modal-footer {
        padding: 10px 15px 20px;
    }
    
    .language-option {
        padding: 15px;
        font-size: 16px;
    }
    
    .close-button {
        top: 10px;
        right: 15px;
        font-size: 24px;
    }
}

/* Animation Classes */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

.slide-in-up {
    animation: slideInUp 0.4s ease-out;
}

/* Loading States */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 1000;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Error and Success States */
.error-message {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    padding: 15px;
    margin: 15px 0;
    text-align: center;
}

.success-message {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    padding: 15px;
    margin: 15px 0;
    text-align: center;
}

/* Accessibility */
.language-option:focus,
.close-button:focus,
.continue-button:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .language-detector-content {
        border: 2px solid #000;
    }
    
    .language-option {
        border-width: 2px;
    }
    
    .language-option:hover {
        border-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .language-option,
    .close-button,
    .continue-button {
        transition: none;
    }
    
    .language-option.suggested {
        animation: none;
    }
}

/* Print styles */
@media print {
    #language-detector-modal {
        display: none !important;
    }
}