/**
 * AgenWebsite Multi-Currency Frontend Styles
 * @since 1.0.0
 */

/* Currency Switcher Widget */
.awmc-currency-switcher-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    background: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #e0e0e0;
}

.awmc-switcher-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.awmc-switcher-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    font-size: 13px;
    color: #333;
    margin: 0;
}

.awmc-switcher-label .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.awmc-currency-select {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    min-width: 100px;
    transition: border-color 0.2s;
}

.awmc-currency-select:hover,
.awmc-currency-select:focus {
    border-color: #2271b1;
    outline: none;
}

/* Dropdown Layout */
.awmc-currency-switcher.awmc-layout-dropdown {
    display: inline-block;
}

.awmc-currency-switcher.awmc-layout-dropdown select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
}

/* Buttons Layout */
.awmc-currency-switcher.awmc-layout-buttons {
    display: inline-block;
}

.awmc-currency-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.awmc-currency-button {
    padding: 8px 16px;
    border: 2px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #333;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.awmc-currency-button:hover {
    border-color: #2271b1;
    color: #2271b1;
}

.awmc-currency-button.active {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

/* List Layout */
.awmc-currency-switcher.awmc-layout-list {
    display: inline-block;
}

.awmc-currency-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.awmc-currency-list li {
    margin: 5px 0;
}

.awmc-currency-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    transition: all 0.2s;
}

.awmc-currency-link:hover {
    border-color: #2271b1;
    color: #2271b1;
    background: #f0f7ff;
}

.awmc-currency-link.active {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
    font-weight: 600;
}

.awmc-current-indicator {
    font-weight: bold;
    margin-left: 10px;
}

/* Loading State */
.awmc-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .awmc-currency-switcher-widget {
        bottom: 10px;
        right: 10px;
        padding: 10px 15px;
    }

    .awmc-switcher-label {
        font-size: 12px;
    }

    .awmc-currency-select {
        font-size: 13px;
        min-width: 80px;
    }

    .awmc-currency-button {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* Admin Product Fields */
.awmc-currency-price-group {
    background: #f9f9f9;
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
}

.awmc-variation-prices {
    border-top: 1px solid #eee;
    padding-top: 10px;
    margin-top: 10px;
}

/* Modal Overlay Styles */
.awmc-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999999;
    display: none;
    animation: fadeIn 0.3s ease;
}

.awmc-modal-dialog {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.awmc-modal-content {
    background: #fff;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

.awmc-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s;
}

.awmc-modal-close:hover {
    color: #000;
}

.awmc-modal-header {
    padding: 30px 30px 20px;
    text-align: center;
}

.awmc-modal-title {
    margin: 0 0 10px;
    font-size: 28px;
    font-weight: 600;
    color: #333;
}

.awmc-modal-description {
    margin: 0;
    font-size: 16px;
    color: #666;
}

.awmc-modal-body {
    padding: 20px 30px 30px;
}

.awmc-currency-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.awmc-currency-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.awmc-currency-option:hover:not(.active):not(:disabled) {
    border-color: #2271b1;
    background: #f0f7ff;
    transform: translateY(-2px);
}

.awmc-currency-option.active {
    border-color: #2271b1;
    background: #2271b1;
    color: #fff;
    cursor: default;
}

.awmc-currency-option:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.awmc-currency-code {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.awmc-currency-symbol {
    font-size: 14px;
    opacity: 0.8;
}

.awmc-currency-current {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 10px;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.3);
    padding: 2px 6px;
    border-radius: 3px;
}

.awmc-modal-footer {
    padding: 20px 30px 30px;
    text-align: center;
}

.awmc-modal-dismiss {
    padding: 12px 30px;
    background: #f0f0f0;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: background 0.2s;
}

.awmc-modal-dismiss:hover {
    background: #e0e0e0;
}

/* Body state when modal is open */
body.awmc-modal-open {
    overflow: hidden;
}

/* Widget Position Variants */
.awmc-currency-switcher-widget.position-top-left {
    top: 20px;
    left: 20px;
    bottom: auto;
    right: auto;
}

.awmc-currency-switcher-widget.position-top-right {
    top: 20px;
    right: 20px;
    bottom: auto;
    left: auto;
}

.awmc-currency-switcher-widget.position-bottom-left {
    bottom: 20px;
    left: 20px;
    top: auto;
    right: auto;
}

.awmc-currency-switcher-widget.position-bottom-right {
    bottom: 20px;
    right: 20px;
    top: auto;
    left: auto;
}

/* Icon-only Widget Mode */
.awmc-widget-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #2271b1;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.3);
    transition: all 0.3s;
    border: none;
    font-size: 20px;
}

.awmc-widget-icon:hover {
    background: #135e96;
    transform: scale(1.1);
}

/* Style Variants */
.awmc-currency-button.style-flat {
    border: none;
    background: #f0f0f0;
}

.awmc-currency-button.style-flat:hover {
    background: #e0e0e0;
}

.awmc-currency-button.style-flat.active {
    background: #2271b1;
    color: #fff;
}

.awmc-currency-button.style-outlined {
    border: 2px solid #ddd;
    background: transparent;
}

.awmc-currency-button.style-outlined:hover {
    border-color: #2271b1;
    color: #2271b1;
}

.awmc-currency-button.style-outlined.active {
    border-color: #2271b1;
    background: #2271b1;
    color: #fff;
}

.awmc-currency-button.style-filled {
    border: none;
    background: #2271b1;
    color: #fff;
}

.awmc-currency-button.style-filled:hover {
    background: #135e96;
}

.awmc-currency-button.style-filled.active {
    background: #0a4b78;
}

/* Font Size Variants */
.awmc-currency-switcher.size-small {
    font-size: 12px;
}

.awmc-currency-switcher.size-small .awmc-currency-select,
.awmc-currency-switcher.size-small .awmc-currency-button {
    font-size: 12px;
    padding: 6px 12px;
}

.awmc-currency-switcher.size-normal {
    font-size: 14px;
}

.awmc-currency-switcher.size-large {
    font-size: 16px;
}

.awmc-currency-switcher.size-large .awmc-currency-select,
.awmc-currency-switcher.size-large .awmc-currency-button {
    font-size: 16px;
    padding: 10px 20px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Mobile Modal Adjustments */
@media (max-width: 600px) {
    .awmc-modal-dialog {
        padding: 0;
        align-items: flex-end;
    }

    .awmc-modal-content {
        border-radius: 12px 12px 0 0;
        max-width: 100%;
        animation: slideUpMobile 0.3s ease;
    }

    .awmc-modal-header {
        padding: 20px 20px 15px;
    }

    .awmc-modal-title {
        font-size: 24px;
    }

    .awmc-modal-body {
        padding: 15px 20px 20px;
    }

    .awmc-currency-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 10px;
    }

    .awmc-currency-option {
        padding: 12px 8px;
    }

    .awmc-currency-code {
        font-size: 16px;
    }
}

@keyframes slideUpMobile {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}
