:root {
    --primary: #9b2dd6;
    --primary-dark: #ab43d1;
    --secondary: #64748b;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --background: #ffffff;
    --surface: #f8fafc;
    --text: #0f172a;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --radius: 0.5rem;
}

/* Widget Button */
.fixed-utility-widgets .currency-widget {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    background-color: var(--primary) !important;
    color: white !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
    transition: transform 0.3s ease !important;
    pointer-events: auto !important;
}

.fixed-utility-widgets .currency-widget:hover {
    transform: translateY(-5px) !important;
}

.fixed-utility-widgets .currency-widget i {
    font-size: 1.5rem !important;
    color: white !important;
}

/* Modal */
.currency-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.currency-modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--background);
    border-radius: var(--radius);
    width: 90%;
    max-width: 500px;
    padding: 1.5rem;
    position: relative;
    box-shadow: var(--shadow);
    max-height: 90vh;
    overflow-y: auto;
}

/* Header */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 1.5rem;
    color: var(--text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-header h2 i {
    color: var(--primary);
}

.close-button {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0.5rem;
    transition: color 0.3s ease;
}

.close-button:hover {
    color: var(--danger);
}

/* Quick Rates */
.quick-rates {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.rate-card {
    background: var(--surface);
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.rate-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.rate-card .currency-name {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.rate-card .rate-value {
    color: var(--text);
    font-size: 1.25rem;
    font-weight: 600;
}

/* Converter */
.converter-section {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-top: 1.5rem;
}

.converter-section h3 {
    color: var(--text);
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
}

.converter-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: center;
}

.amount-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.amount-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.currency-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    background-color: white;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
}

.currency-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.swap-button {
    background: var(--primary);
    color: white;
    border: none;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.swap-button:hover {
    background: var(--primary-dark);
    transform: rotate(180deg);
}

.result-section {
    margin-top: 1.5rem;
    text-align: center;
}

.conversion-result {
    font-size: 1.5rem;
    color: var(--text);
    font-weight: 600;
    margin: 0;
    padding: 1rem;
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

/* Footer */
.modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.last-updated {
    color: var(--text-light);
    font-size: 0.875rem;
}

.refresh-button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.refresh-button:hover {
    background: var(--primary-dark);
}

.refresh-button i {
    transition: transform 0.3s ease;
}

.refresh-button:hover i {
    transform: rotate(180deg);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 1s linear infinite;
}

/* Loading State */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading i {
    animation: spin 1s linear infinite;
}

/* Responsive Design */
@media (max-width: 640px) {
    .modal-content {
        width: 95%;
        padding: 1rem;
    }

    .converter-grid {
        grid-template-columns: 1fr;
    }

    .swap-button {
        margin: 0.5rem auto;
        transform: rotate(90deg);
    }

    .swap-button:hover {
        transform: rotate(270deg);
    }

    .quick-rates {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 1rem 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1001;
    animation: slideUp 0.3s ease;
}

.toast.success {
    background: var(--success);
    color: white;
}

.toast.error {
    background: var(--danger);
    color: white;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, 1rem);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* Value Update Animation */
.value-updated {
    animation: highlight-value 1.5s ease;
}

@keyframes highlight-value {
    0% { background-color: rgba(0, 86, 179, 0.1); }
    50% { background-color: rgba(0, 86, 179, 0.2); }
    100% { background-color: transparent; }
}

/* Refresh Button Styles */
.refresh-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(37, 99, 235, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(37, 99, 235, 0.1);
}

.last-updated {
    font-size: 0.9rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.last-updated i {
    color: #2563eb;
    font-size: 0.8rem;
}

.refresh-button-modern {
    position: relative;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    border: none;
    padding: 0.75rem;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
    overflow: hidden;
}

.refresh-button-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1), rgba(255,255,255,0.2));
    border-radius: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.refresh-button-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
}

.refresh-button-modern:hover::before {
    opacity: 1;
}

.refresh-button-modern:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

.refresh-button-modern i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.refresh-button-modern.refreshing {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    pointer-events: none;
}

.refresh-button-modern.refreshing i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Loading State Pulse Animation */
.refresh-button-modern.refreshing::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 14px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    z-index: -1;
    animation: pulse 1.5s ease infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 0.25;
        transform: scale(1.05);
    }
    100% {
        opacity: 0.5;
        transform: scale(1);
    }
}

/* Success Animation */
.refresh-button-modern.success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.refresh-button-modern.success i {
    animation: success-bounce 0.5s ease;
}

@keyframes success-bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-4px);
    }
    60% {
        transform: translateY(-2px);
    }
}

/* Mobile Optimization */
@media (max-width: 768px) {
    .refresh-container {
        padding: 0.75rem;
    }
    
    .refresh-button-modern {
        width: 38px;
        height: 38px;
        padding: 0.6rem;
    }
    
    .last-updated {
        font-size: 0.8rem;
    }
}

/* Touch Device Optimization */
@media (hover: none) {
    .refresh-button-modern:hover {
        transform: none;
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
    }
    
    .refresh-button-modern:active {
        transform: scale(0.95);
    }
} 