/* ========================================
   COWSWAP DRAINER - DEOBFUSCATED STYLES
   Security Analysis Version
   ======================================== */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #23191A;
    min-height: 100vh;
}

/* Main Container */
.swap-container {
    margin: 0 auto;
    display: flex;
    background: #65D9FF;
    flex-direction: column;
    gap: 1rem;
    min-height: 95vh;
    position: relative;
    border-bottom-left-radius: 5rem;
    border-bottom-right-radius: 5rem;
}

/* Background Cow Image */
.cowbg {
    position: absolute;
    z-index: 1;
    bottom: 0;
    width: 100%;
    border-bottom-left-radius: 5rem;
    border-bottom-right-radius: 5rem;
}

/* Navigation Bar */
.navbar {
    background: #A3E5FC;
    width: 90%;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    margin: 1rem auto 0;
    border-radius: 10rem;
}

.navbar img {
    width: 150px;
}

.navbar button,
.connect-button {
    background: #004293;
    padding: 0.5rem 1rem;
    border: 2px solid white;
    color: #5ECFF8;
    border-radius: 10rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    gap: 0.5rem;
    min-height: 2.5rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #2563eb;
}

.btn-ghost {
    background: transparent;
    color: #374151;
}

.btn-ghost:hover:not(:disabled) {
    background: #f3f4f6;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    min-height: 3rem;
}

.btn-icon {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border-radius: 50%;
}

.btn-full {
    width: 100%;
}

/* Card Styles */
.card {
    background: white;
    border-radius: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    overflow: hidden;
    width: 90%;
    max-width: 500px;
    margin: 2rem auto 0;
    padding: 1rem;
    z-index: 10;
}

.card-header {
    padding-bottom: 1rem;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-content {
    padding-top: 0;
}

/* Form Elements */
.form-group {
    margin: 1rem 0;
    background: #F2F2F2;
    padding: 1rem;
    border-radius: 1.5rem;
}

.form-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.flex-1 {
    flex: 1 1;
}

.input {
    width: 100%;
    padding: 0;
    border: none;
    background: transparent;
    min-height: 2.5rem;
    font-size: 1.5rem;
    color: black;
}

.input:focus {
    outline: none;
    border-color: none;
}

.input-search {
    padding-left: 2.5rem;
}

/* Token Button */
.token-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 10rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    font-weight: 700;
}

.token-btn:hover {
    background: #f9fafb;
}

.token-img {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
}

/* Balance Display */
.balance-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.balance {
    font-size: 0.75rem;
    color: #6b7280;
}

.balance-loading {
    margin-left: 0.5rem;
    font-size: 0.75rem;
}

.max-btn {
    font-size: 0.75rem;
    color: #2563eb;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: color 0.2s ease;
}

.max-btn:hover {
    color: #1e40af;
}

/* Swap Arrow */
.swap-arrow {
    background: #F2F2F2;
    border: 5px solid white;
    width: fit-content;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 1rem;
    margin: -1.5rem auto -2rem;
}

.arrow-icon {
    width: 1.25rem;
    height: 1.25rem;
}

/* Quote Info */
.quote-info {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

.quote-info p {
    margin-bottom: 0.25rem;
}

/* Modal/Dialog Styles */
.dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 1rem;
}

.dialog-content {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 28rem;
    max-height: 90vh;
    overflow-y: auto;
}

.dialog-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.dialog-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
}

.dialog-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Search Container */
.search-container {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    width: 1rem;
    height: 1rem;
}

/* Token List */
.token-list {
    max-height: 20rem;
    overflow-y: auto;
}

.token-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-radius: 0.375rem;
    margin-bottom: 0.25rem;
}

.token-item:hover {
    background: #f3f4f6;
}

.token-item-img {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
}

.token-item-info {
    flex: 1 1;
}

.token-item-symbol {
    font-weight: 500;
    color: #111827;
}

.token-item-name {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Loading Indicator */
.loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.spinner {
    width: 0.75rem;
    height: 0.75rem;
    border: 2px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 100;
    max-width: 20rem;
}

.toast-error {
    border-color: #ef4444;
    background: #fef2f2;
}

.toast-success {
    border-color: #10b981;
    background: #f0fdf4;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.toast-description {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Responsive Design */
@media (max-width: 640px) {
    .card {
        width: 95%;
        padding: 0.75rem;
    }

    .navbar {
        width: 95%;
    }

    .dialog-content {
        margin: 0.5rem;
    }
}

/* Reown AppKit Custom Styles */
w3m-modal,
w3m-button,
wcm-modal,
wcm-button,
appkit-modal,
appkit-button,
#WEB3_CONNECT_MODAL_ID {
    z-index: 999999 !important;
}

/* Web3Modal Theme Overrides */
:root {
    --w3m-accent-color: #65D9FF !important;
    --w3m-accent-fill-color: #004293 !important;
    --w3m-background-color: #1a1a1a !important;
    --w3m-color-bg-1: #1a1a1a !important;
    --w3m-color-bg-2: #2a2a2a !important;
    --w3m-color-fg-1: #ffffff !important;
    --w3m-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;

    /* WalletConnect Modal Colors */
    --wcm-accent-color: #65D9FF !important;
    --wcm-accent-fill-color: #004293 !important;
    --wcm-background-color: #1a1a1a !important;
    --wcm-overlay-background-color: rgba(0, 0, 0, 0.6) !important;
}

/* Web3Modal Container Styling */
#walletconnect-wrapper {
    color: #ffffff !important;
}

#walletconnect-qrcode-modal {
    z-index: 999999 !important;
}

.web3modal-modal-lightbox {
    z-index: 999999 !important;
    background: rgba(0, 0, 0, 0.6) !important;
}

.web3modal-modal-card {
    background: #1a1a1a !important;
    border-radius: 24px !important;
    border: 1px solid #3a3a3a !important;
}

.web3modal-provider-container {
    background: #2a2a2a !important;
    border-radius: 12px !important;
    border: 1px solid #3a3a3a !important;
    transition: all 0.2s ease !important;
}

.web3modal-provider-container:hover {
    background: #3a3a3a !important;
    border-color: #65D9FF !important;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Remove number input arrows */
input::-webkit-inner-spin-button,
input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}
