/**
 * Currency Converter Styles
 * Styles for the currency selector dropdown in navigation menu
 */

/* Currency Selector Container */
.currency-selector-wrapper {
    position: relative;
    list-style: none;
}

.currency-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(30, 64, 175, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(30, 64, 175, 0.3);
    border-radius: 8px;
    text-decoration: none;
    color: #1e40af;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    min-width: 180px;
    justify-content: space-between;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.currency-trigger:hover {
    background: rgba(30, 64, 175, 0.25);
    border-color: rgba(30, 64, 175, 0.5);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* When header is scrolled (dark background) */
.header.scrolled .currency-trigger {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

.header.scrolled .currency-trigger:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.header.scrolled .currency-code {
    color: #ffffff;
}

.header.scrolled .currency-arrow {
    color: rgba(255, 255, 255, 0.8);
}

.currency-flag {
    font-size: 20px;
    line-height: 1;
    min-width: 24px;
    text-align: center;
    display: inline-block;
}

.currency-code {
    font-weight: 600;
    letter-spacing: 0.3px;
    color: #1e40af;
    flex: 1;
}

.currency-arrow {
    font-size: 12px;
    color: rgba(30, 64, 175, 0.8);
    transition: transform 0.3s ease;
}

.currency-trigger:hover .currency-arrow {
    color: #1e40af;
}

.currency-dropdown.show .currency-arrow {
    transform: rotate(180deg);
}

/* Currency Dropdown */
.currency-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    min-width: 280px;
    max-width: 320px;
    max-height: 450px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 10000;
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid #e5e7eb;
}

.currency-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.currency-dropdown-header {
    padding: 16px 20px;
    background: #f9fafb;
    color: #1f2937;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
}

.currency-dropdown-header span {
    font-weight: 600;
    font-size: 14px;
    color: #374151;
}

.currency-dropdown-header small {
    font-size: 11px;
    color: #6b7280;
}

/* Currency Options */
.currency-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f3f4f6;
    position: relative;
    background: white;
}

.currency-option:last-child {
    border-bottom: none;
}

.currency-option:hover {
    background: #f9fafb;
}

.currency-option.active {
    background: #eff6ff;
    border-left: 3px solid #3b82f6;
}

.currency-option.active:hover {
    background: #dbeafe;
}

.currency-option .currency-flag {
    font-size: 24px;
    line-height: 1;
    min-width: 32px;
    text-align: center;
}

.currency-option .currency-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.currency-option .currency-info strong {
    font-size: 15px;
    color: #1f2937;
    font-weight: 600;
}

.currency-option .currency-info small {
    font-size: 12px;
    color: #6b7280;
    font-weight: 400;
}

.currency-option .checkmark {
    color: #3b82f6;
    font-size: 18px;
    font-weight: bold;
    animation: checkmarkPop 0.3s ease;
}

@keyframes checkmarkPop {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

/* Scrollbar for dropdown */
.currency-dropdown::-webkit-scrollbar {
    width: 6px;
}

.currency-dropdown::-webkit-scrollbar-track {
    background: #f9fafb;
}

.currency-dropdown::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.currency-dropdown::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Mobile Navigation Specific Styles */
@media (max-width: 768px) {

    /* Currency selector in mobile nav menu */
    .nav-menu .currency-selector-wrapper {
        width: auto;
        margin: 0;
        padding: 0;
    }

    .nav-menu .currency-trigger {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.2);
        color: #ffffff;
        margin: 10px 16px;
        border-radius: 8px;
        width: auto;
        max-width: calc(100vw - 32px);
        min-width: auto;
        padding: 16px 20px;
        font-size: 1.15rem;
        min-height: 44px;
        box-shadow: 0 8px 24px rgba(11, 35, 80, 0.15);
        justify-content: flex-start;
        gap: 12px;
        box-sizing: border-box;
    }

    .nav-menu .currency-trigger:hover {
        background: rgba(255, 255, 255, 0.12);
        border-color: rgba(255, 255, 255, 0.3);
    }

    .nav-menu .currency-flag {
        font-size: 22px;
        min-width: 28px;
        flex-shrink: 0;
    }

    .nav-menu .currency-code {
        color: #ffffff;
        font-size: 1.15rem;
        font-weight: 600;
        flex: 1;
        text-align: left;
    }

    .nav-menu .currency-arrow {
        color: rgba(255, 255, 255, 0.7);
        font-size: 14px;
        margin-left: auto;
        flex-shrink: 0;
    }

    .nav-menu .currency-dropdown {
        background: rgba(30, 58, 138, 0.98);
        border-color: rgba(255, 255, 255, 0.1);
        position: static;
        width: auto;
        max-width: calc(100vw - 32px);
        margin: 0 16px 10px 16px;
        transform: none;
        border-radius: 8px;
        opacity: 1;
        visibility: visible;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .nav-menu .currency-dropdown.show {
        transform: none;
    }

    .nav-menu .currency-dropdown-header {
        background: rgba(255, 255, 255, 0.05);
        border-bottom-color: rgba(255, 255, 255, 0.1);
        padding: 14px 16px;
    }

    .nav-menu .currency-dropdown-header span {
        color: #ffffff;
        font-size: 15px;
    }

    .nav-menu .currency-dropdown-header small {
        color: rgba(255, 255, 255, 0.7);
        font-size: 12px;
    }

    .nav-menu .currency-dropdown-section {
        background: rgba(255, 255, 255, 0.03);
        color: rgba(255, 255, 255, 0.6);
        padding: 10px 16px 6px;
    }

    .nav-menu .currency-option {
        background: transparent;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        color: #fff;
        padding: 16px;
        min-height: 60px;
    }

    .nav-menu .currency-option:hover {
        background: rgba(255, 255, 255, 0.05);
    }

    .nav-menu .currency-option.active {
        background: rgba(251, 191, 36, 0.15);
        border-left: 3px solid #FFD700;
    }

    .nav-menu .currency-option .currency-flag {
        font-size: 26px;
        min-width: 36px;
    }

    .nav-menu .currency-option .currency-info strong {
        color: #ffffff;
        font-size: 16px;
    }

    .nav-menu .currency-option .currency-info small {
        color: rgba(255, 255, 255, 0.7);
        font-size: 13px;
    }

    .nav-menu .currency-option .checkmark {
        color: #FFD700;
        font-size: 20px;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .currency-trigger {
        padding: 10px 14px;
        font-size: 14px;
        min-height: 42px;
    }

    .currency-code {
        font-size: 14px;
    }

    .currency-dropdown {
        max-height: 70vh;
    }

    .currency-option {
        padding: 14px;
        min-height: 56px;
    }

    .currency-option .currency-info strong {
        font-size: 15px;
    }

    .currency-option .currency-info small {
        font-size: 12px;
    }
}

/* Tablet */
@media (max-width: 1024px) and (min-width: 769px) {
    .currency-trigger {
        min-width: 160px;
        padding: 10px 18px;
    }

    .currency-dropdown {
        min-width: 300px;
    }
}

/* Price elements styling */
[data-price-pkr] {
    transition: all 0.3s ease;
    display: inline-block;
}

[data-price-pkr].updating {
    opacity: 0.5;
}

/* Currency indicator badge */
.currency-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: white;
    color: #3b82f6;
    border: 1px solid #3b82f6;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
    vertical-align: middle;
}

.currency-badge .flag {
    font-size: 14px;
}

/* Loading indicator */
.currency-loading {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Smooth price transition */
.price-transition {
    animation: priceUpdate 0.5s ease;
}

@keyframes priceUpdate {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(1.05);
    }
}

/* Currency note */
.currency-note {
    font-size: 11px;
    color: #6b7280;
    font-style: italic;
    margin-top: 5px;
    display: block;
}

.currency-note::before {
    content: "ℹ️ ";
}

/* Suggested section in dropdown */
.currency-dropdown-section {
    padding: 8px 20px 4px;
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f9fafb;
}

/* Divider between sections */
.currency-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 4px 0;
}