/**
 * 2007-2024 PrestaShop
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * https://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@prestashop.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to http://www.prestashop.com for more information.
 *
 * @author    Gemini <contact@yourdomain.com>
 * @copyright 2007-2024 PrestaShop SA
 * @license   https://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 * International Registered Trademark & Property of PrestaShop SA
 */

/* Popup Wrapper Container */
.tx-locale-switcher-popup-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Popup Overlay (Backdrop) */
.tx-locale-switcher-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: -1;
    animation: fadeIn 0.3s ease-in-out;
}

/* Popup Modal */
.tx-locale-switcher-popup-modal {
    position: relative;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden; /* Changed from auto to hidden */
    animation: slideUp 0.3s ease-in-out;
}

/* New styles for two-column layout */
.tx-locale-switcher-popup-modal.with-image {
    display: flex;
    max-width: 900px; /* Increased max-width for a wider, more modern look */
    width: 90%;
}

.tx-locale-switcher-image-panel {
    width: 50%;
    flex-shrink: 0;
    background-color: #f5f5f5; /* A light background for the image area */
    border-radius: 8px 0 0 8px;
}

.tx-locale-switcher-image-panel img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 8px 0 0 8px;
}

.tx-locale-switcher-content-panel {
    width: 50%;
    display: flex;
    flex-direction: column;
    overflow: auto; /* Allow content to scroll if it's too long */
    padding: 20px; /* Add some padding around the content panel */
}

/* Popup Header */
.tx-locale-switcher-popup-header {
    flex-shrink: 0; /* Prevent header from shrinking */
    padding: 24px;
    border-bottom: 1px solid #e9e9e9;
    position: relative;
}

.tx-locale-switcher-title {
    margin: 0 0 8px 0;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    color: #333;
}

.tx-locale-switcher-subtitle {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

/* Close Button */
.tx-locale-switcher-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.tx-locale-switcher-close-btn:hover {
    color: #333;
}

.tx-locale-switcher-close-btn:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Form Body */
.tx-locale-switcher-form {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.tx-locale-switcher-body {
    padding: 24px;
    flex: 1;
}

/* Selection Sections */
.tx-locale-switcher-section {
    margin-bottom: 24px;
}

.tx-locale-switcher-section:last-child {
    margin-bottom: 0;
}

.tx-locale-switcher-label {
    display: block;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

/* Select Dropdowns */
.tx-locale-switcher-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
}

.tx-locale-switcher-select:hover {
    border-color: #bbb;
}

.tx-locale-switcher-select:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* Select Options Styling */
.tx-locale-switcher-select option {
    padding: 8px 0;
    line-height: 1.5;
}

/* Popup Footer */
.tx-locale-switcher-footer {
    flex-shrink: 0; /* Prevent footer from shrinking */
    padding: 16px 24px;
    border-top: 1px solid #e9e9e9;
    background-color: #f5f5f5;
    border-radius: 0 0 8px 8px;
}

.tx-locale-switcher-popup-modal.with-image .tx-locale-switcher-footer {
    border-radius: 0 0 8px 0; /* Adjust footer border-radius when image is present */
}

/* Continue Button */
.tx-locale-switcher-continue-btn {
    width: 100%;
    padding: 12px 24px;
    background-color: #0066cc;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
}

.tx-locale-switcher-continue-btn:hover {
    background-color: #0052a3;
}

.tx-locale-switcher-continue-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.3);
}

.tx-locale-switcher-continue-btn:active {
    background-color: #003d7a;
}

/* Loading State */
.tx-locale-switcher-continue-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.tx-locale-switcher-continue-btn.loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .tx-locale-switcher-popup-modal {
        width: 95%;
        max-width: 100%;
    }

    /* Stack columns on mobile */
    .tx-locale-switcher-popup-modal.with-image {
        flex-direction: column;
        max-width: 400px;
    }

    .tx-locale-switcher-image-panel {
        width: 100%;
        height: 180px; /* Fixed height for image on mobile */
    }

    .tx-locale-switcher-content-panel {
        width: 100%;
    }
    .tx-locale-switcher-popup-header {
        padding: 20px;
    }

    .tx-locale-switcher-body {
        padding: 20px;
    }

    .tx-locale-switcher-title {
        font-size: 18px;
    }

    .tx-locale-switcher-subtitle {
        font-size: 13px;
    }

    .tx-locale-switcher-footer {
        padding: 12px 20px;
    }
}

@media (max-width: 480px) {
    .tx-locale-switcher-popup-wrapper {
        padding: 16px;
    }

    .tx-locale-switcher-popup-modal {
        width: 100%;
        border-radius: 12px;
    }

    .tx-locale-switcher-popup-header {
        padding: 16px;
    }

    .tx-locale-switcher-body {
        padding: 16px;
    }

    .tx-locale-switcher-title {
        font-size: 16px;
    }

    .tx-locale-switcher-label {
        font-size: 13px;
    }

    .tx-locale-switcher-select {
        font-size: 16px;
    }

    .tx-locale-switcher-continue-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* Error Message (for future use) */
.tx-locale-switcher-error {
    padding: 12px;
    margin-bottom: 16px;
    background-color: #fee;
    border: 1px solid #fcc;
    border-radius: 4px;
    color: #c33;
    font-size: 13px;
}

/* Success Message (for future use) */
.tx-locale-switcher-success {
    padding: 12px;
    margin-bottom: 16px;
    background-color: #efe;
    border: 1px solid #cfc;
    border-radius: 4px;
    color: #3c3;
    font-size: 13px;
}
