:root {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-card: #0f3460;
    --accent: #e94560;
    --accent-hover: #ff6b6b;
    --text-primary: #eaeaea;
    --text-secondary: #a0a0a0;
    --border-color: #2a2a4a;
    --success: #4ade80;
    --error: #ef4444;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.header {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 2rem;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent), #ffd93d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Address Input Section */
.address-input-section {
    margin-bottom: 2rem;
}

.address-form {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.address-input {
    flex: 1;
    min-width: 250px;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.address-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.2);
}

.address-input::placeholder {
    color: var(--text-secondary);
}

/* Buttons */
.btn {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--accent);
}

.btn-loader {
    width: 18px;
    height: 18px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Saved Addresses */
.saved-addresses-section {
    margin-bottom: 2rem;
}

.saved-addresses-section h2 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.saved-addresses-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.saved-address-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.saved-address-item:hover {
    border-color: var(--accent);
    background: var(--bg-card);
}

.saved-address-item .address-text {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

.saved-address-item .remove-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1rem;
    line-height: 1;
    transition: color 0.2s;
}

.saved-address-item .remove-btn:hover {
    color: var(--error);
}

.no-addresses {
    color: var(--text-secondary);
    font-style: italic;
}

/* NFT Section */
.nft-section {
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.nft-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.nft-header h2 {
    font-size: 1.25rem;
}

.nft-header h2 span {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--text-secondary);
    word-break: break-all;
}

/* NFT Grid */
.nft-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.nft-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
}

.nft-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: var(--accent);
}

.nft-card-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: var(--bg-card);
}

.nft-card-info {
    padding: 1rem;
}

.nft-card-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nft-card-id {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Loading State */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    gap: 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Error & Empty States */
.error-message {
    color: var(--error);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.error-container {
    text-align: center;
    padding: 2rem;
}

.error-container .error-message {
    margin-bottom: 1rem;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-size: 1.125rem;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--bg-card);
    border: none;
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 1;
}

.modal-close:hover {
    background: var(--accent);
}

.modal-body {
    padding: 0;
}

.modal-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    background: var(--bg-card);
}

.modal-info {
    padding: 1.5rem;
}

.modal-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.modal-info p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.modal-details {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.modal-details p {
    margin: 0;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 600px) {
    .logo h1 {
        font-size: 1.25rem;
    }

    .address-form {
        flex-direction: column;
    }

    .address-input {
        min-width: 100%;
    }

    .btn {
        width: 100%;
    }

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

    .nft-header h2 {
        font-size: 1rem;
    }
}

/* Pull to refresh indicator (touch devices) */
.pull-indicator {
    text-align: center;
    padding: 1rem;
    color: var(--text-secondary);
    transition: opacity 0.2s;
}
