@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-bg: #0a0e1a;
    --secondary-bg: #121829;
    --card-bg: #1a1f36;
    --hover-bg: #2a3142;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-cyan: #06b6d4;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #334155;
    --glow-blue: rgba(59, 130, 246, 0.5);
    --glow-purple: rgba(139, 92, 246, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--primary-bg);
    color: var(--text-primary);
    overflow-x: hidden;
    position: relative;
}

/* Animated background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, rgba(6, 182, 212, 0.08) 0%, transparent 50%);
    z-index: -1;
    animation: backgroundShift 15s ease-in-out infinite;
}

@keyframes backgroundShift {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}

/* Header */
.header {
    padding: 20px 0;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.navbar-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary);
}

.navbar-logo img {
    width: 40px;
    height: 40px;
    margin-right: 12px;
}

.logo-text {
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.connect-btn {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    color: white;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

.connect-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

/* Main Content */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

.hero-section {
    text-align: center;
    margin-bottom: 60px;
}

.hero-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-cyan));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* Search Section */
.search-container {
    position: relative;
    max-width: 415px;
    margin: 0 auto 50px;
}

.search-box {
    width: 100%;
    background: var(--card-bg);
    border: 2px solid transparent;
    border-radius: 16px;
    padding: 15px 21px 15px 36px;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.search-box:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: rgba(26, 31, 54, 0.8);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
}

.clear-search {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 20px;
    padding: 8px;
    transition: all 0.2s ease;
    display: none;
}

.clear-search:hover {
    color: var(--text-primary);
}

/* Wallet Grid */
.wallet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.wallet-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.wallet-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent, rgba(59, 130, 246, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wallet-card:hover::before {
    opacity: 1;
}

.wallet-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-blue);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 20px rgba(59, 130, 246, 0.2);
}

.wallet-header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    position: relative;
    z-index: 2;
}

.wallet-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    margin-right: 16px;
    overflow: hidden;
    background: var(--secondary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border-color);
}

.wallet-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wallet-info h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.wallet-info p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
    font-weight: 500;
}

.wallet-status {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

/* No results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    display: none;
}

.no-results i {
    font-size: 48px;
    margin-bottom: 20px;
    color: var(--text-muted);
}

.no-results h3 {
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(10, 14, 26, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    padding: 0;
    overflow: hidden;
    animation: modalSlideUp 0.3s ease-out;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 10px 20px 0;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: flex-start;
    width: 100%;
    position: relative;
}

.modal-close {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    padding-top: 12px;
    padding-right: 24px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-wallet-icon {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--border-color);
}

.modal-wallet-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-topbar {
    line-height: 1;
    margin: auto 0 auto 8px;
}

.modal-topbar h3 {
    font-size: 16px;
    font-weight: 600;
}

.modal-topbar p {
    font-size: 14px;
    color: var(--text-secondary);
}

.modal-body {
    padding: 20px 15px;
}

.status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 12px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.phrase-form {
    margin-top: 5px;
}

.phrase-input {
    width: 100%;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    color: var(--text-primary);
    font-size: 14px;
    resize: vertical;
    min-height: 120px;
    transition: all 0.3s ease;
}

.phrase-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border: none;
    border-radius: 10px;
    padding: 12px;
    color: white;
    font-weight: 600;
    font-size: 15px;
    margin-top: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Footer */
.footer {
    margin-top: 80px;
    padding: 40px 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-container {
        padding: 20px 16px;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.125rem;
    }

    .wallet-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 15px;
    }

    .wallet-card {
        padding: 15px;
    }

    .wallet-icon {
        width: 50px;
        height: 50px;
        border-radius: 12px;
        margin-right: 10px;
    }

    .wallet-info h3 {
        font-size: 15px;
        font-weight: 600;
        margin-top: 5px;
        margin-bottom: 3px;
    }

    .wallet-info p {
        font-size: 12px;
    }

    .wallet-card {
        border-radius: 12px;
        padding: 15px;
    }

    .modal-content {
        width: 95%;
        margin: 20px;
    }

    .search-container {
        margin-bottom: 30px;
    }
}

@media (max-width: 480px) {
    .navbar {
        padding: 0 15px;
    }

    /* Main Content */
    .main-container {
        padding: 40px 15px;
    }

    .wallet-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .wallet-card {
        padding: 15px;
    }

    .wallet-icon {
        width: 44px;
        height: 44px;
        border-radius: 10px;
        margin-right: 7px;
    }

    .wallet-info h3 {
        font-size: 14px;
        margin-top: 5px;
        margin-bottom: 3px;
    }

    .wallet-info p {
        font-size: 12px;
    }

    .wallet-card {
        border-radius: 12px;
        padding: 15px;
    }

    .search-box {
        padding: 16px 20px 16px 50px;
        font-size: 15px;
    }

    .hero-section {
        margin-bottom: 40px;
    }
}

/* Loading states */
.wallet-card.loading {
    pointer-events: none;
    opacity: 0.6;
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 376px) {

    .wallet-grid {
        grid-template-columns: 1fr;
    }

}