/**
 * NFT Dashboard - Modern Gallery UI
 * Clean grid layout, premium cards, inline controls
 */

/* Dashboard Container */
.dashboard-container {
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Dashboard Hero */
.dashboard-hero {
    padding: 5rem 0 2rem;
    position: relative;
    text-align: center;
}

.dashboard-hero .hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.22);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #a78bfa;
    margin-bottom: 1.25rem;
    animation: fadeInDown 0.5s ease-out;
}

.dashboard-hero .hero-badge svg { color: #a78bfa; }

.dashboard-hero .gradient-text {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 0.6rem;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #c4b5fd 0%, #818cf8 40%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 0.5s ease-out 0.1s both;
}

.dashboard-hero .hero-subtitle {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.5s ease-out 0.2s both;
}

.wallet-status-card {
    max-width: 480px;
    margin: 0 auto;
    animation: fadeInUp 0.5s ease-out 0.3s both;
}

.wallet-disconnected,
.wallet-connected {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
}

.wallet-disconnected:hover {
    border-color: rgba(139, 92, 246, 0.35);
    background: rgba(139, 92, 246, 0.04);
}

.wallet-info { display: flex; align-items: center; gap: 10px; flex: 1; }

.wallet-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
}

.wallet-address {
    font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
}

.btn-disconnect {
    padding: 8px 16px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 10px;
    color: #f87171;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-disconnect:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.45);
}

/* Connect Prompt */
.connect-prompt-section { padding: 5rem 0; }

.connect-card {
    max-width: 480px;
    margin: 0 auto;
    padding: 3.5rem 2.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 24px;
    text-align: center;
    animation: scaleIn 0.45s ease-out;
}

.connect-icon { margin-bottom: 1.5rem; }

.connect-icon svg {
    color: rgba(139, 92, 246, 0.5);
    filter: drop-shadow(0 4px 20px rgba(139, 92, 246, 0.2));
}

.connect-card h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.75rem;
}

.connect-card p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Loading, Error, Empty States */
.loading-section,
.error-section,
.empty-section { padding: 5rem 0; }

.loading-card,
.error-card,
.empty-card {
    max-width: 460px;
    margin: 0 auto;
    padding: 3rem 2rem;
    text-align: center;
}

.loader-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(139, 92, 246, 0.15);
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    margin: 0 auto 1.25rem;
}

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

.loading-card p,
.error-card p,
.empty-card p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 1.5rem;
}

.error-card svg,
.empty-card svg {
    color: rgba(139, 92, 246, 0.35);
    margin-bottom: 1.25rem;
}

.error-card h3,
.empty-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.75rem;
}

/* Gallery Toolbar */
.gallery-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 0 0.25rem;
}

.toolbar-stats { display: flex; gap: 1.5rem; margin-right: auto; }

.toolbar-stat { display: flex; align-items: baseline; gap: 0.4rem; }

.toolbar-stat .stat-num {
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, #c4b5fd, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.toolbar-stat .stat-lbl {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.toolbar-search { position: relative; width: 260px; }

.toolbar-search svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.3);
    pointer-events: none;
}

.toolbar-search input {
    width: 100%;
    padding: 10px 14px 10px 42px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 0.88rem;
    font-family: inherit;
    transition: all 0.25s;
    box-sizing: border-box;
}

.toolbar-search input::placeholder { color: rgba(255, 255, 255, 0.3); }

.toolbar-search input:focus {
    outline: none;
    border-color: rgba(139, 92, 246, 0.45);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.08);
}

.toolbar-filters { display: flex; gap: 0.4rem; }

.filter-pill {
    padding: 7px 14px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.25s;
    white-space: nowrap;
}

.filter-pill:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.8);
}

.filter-pill.active {
    background: rgba(139, 92, 246, 0.12);
    border-color: rgba(139, 92, 246, 0.45);
    color: #c4b5fd;
}

/* NFT Grid Gallery */
.nft-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
    animation: fadeInUp 0.4s ease-out;
}

.nft-gallery-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.95rem;
}

/* NFT Card */
.nft-card {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
    display: flex;
    flex-direction: column;
}

.nft-card:hover {
    border-color: rgba(139, 92, 246, 0.35);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(139, 92, 246, 0.15);
    transform: translateY(-4px);
}

.nft-image-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.03);
}

.nft-revoked-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fca5a5;
    font-size: 0.74rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    cursor: help;
}

.nft-revoked-indicator::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    padding: 5px 8px;
    border-radius: 7px;
    background: rgba(17, 17, 17, 0.9);
    border: 1px solid rgba(239, 68, 68, 0.45);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.66rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(-2px);
    pointer-events: none;
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.nft-revoked-indicator:hover::after {
    opacity: 1;
    transform: translateY(0);
}

.nft-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
    display: block;
}

.nft-card:hover .nft-image { transform: scale(1.03); }

.nft-info {
    padding: 1rem 1.15rem 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    flex: 1;
}

.nft-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.nft-card-title-group { flex: 1; min-width: 0; }

.nft-card-name {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.nft-card-symbol {
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.nft-origin-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 6px;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    flex-shrink: 0;
}

.nft-origin-badge.created-here {
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.35);
    color: #a78bfa;
}

.nft-origin-badge.external {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
}

.nft-actions { margin-top: auto; }

.btn-edit {
    width: 100%;
    padding: 9px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-edit:hover:not(:disabled) {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.4);
    color: #c4b5fd;
}

.btn-edit:disabled { opacity: 0.3; cursor: not-allowed; }

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal.active { display: flex; }

.modal-backdrop {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    animation: fadeIn 0.25s ease;
}

.modal-dialog {
    position: relative;
    max-width: 520px;
    width: 92%;
    max-height: 90vh;
    overflow-y: auto;
    background: linear-gradient(160deg, rgba(17, 24, 39, 0.97), rgba(15, 23, 42, 0.97));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.35rem;
    font-weight: 700;
    background: linear-gradient(135deg, #c4b5fd, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.modal-close {
    width: 36px; height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    transform: rotate(90deg);
}

.modal-body { padding: 1.5rem; }
.nft-preview { margin-bottom: 1.5rem; }
.form-group { margin-bottom: 1.25rem; }

.form-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-control {
    width: 100%;
    padding: 11px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #ffffff;
    font-size: 0.92rem;
    font-family: inherit;
    transition: all 0.25s;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: rgba(139, 92, 246, 0.45);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.08);
}

.form-help {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.35);
}

textarea.form-control {
    resize: vertical;
    min-height: 70px;
    line-height: 1.5;
}

/* Cost Breakdown */
.edit-cost-breakdown {
    background: rgba(139, 92, 246, 0.04);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 12px;
    padding: 1rem 1.15rem;
    margin-bottom: 1.25rem;
}

.cost-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.75rem;
}

.cost-header svg {
    color: #a78bfa;
}

.cost-rows {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.55);
}

.cost-row span:last-child {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    font-variant-numeric: tabular-nums;
}

.cost-row-total {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 8px;
    margin-top: 4px;
    font-size: 0.92rem;
}

.cost-row-total span:first-child {
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
}

.cost-row-total span:last-child {
    font-weight: 700;
    color: #c4b5fd;
    font-size: 0.95rem;
}

.cost-row-usd span:last-child {
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.35);
}

.burn-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.burn-confirm-modal {
    width: min(440px, 100%);
    background: rgba(17, 17, 22, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.48);
    padding: 1.15rem 1.15rem 1rem;
}

.burn-confirm-modal h4 {
    margin: 0 0 0.55rem;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.94);
}

.burn-confirm-modal p {
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.72);
}

.burn-confirm-mini {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.58rem;
    color: rgba(255, 255, 255, 0.22);
}

.burn-confirm-actions {
    margin-top: 0.9rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.55rem;
}

.burn-notice {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 2100;
    max-width: min(420px, calc(100vw - 32px));
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(20, 20, 24, 0.95);
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.82rem;
    line-height: 1.4;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.burn-notice.success {
    border-color: rgba(16, 185, 129, 0.45);
    color: rgba(110, 231, 183, 0.95);
}

.burn-notice.warning {
    border-color: rgba(245, 158, 11, 0.45);
    color: rgba(253, 186, 116, 0.95);
}

.burn-notice.error {
    border-color: rgba(239, 68, 68, 0.45);
    color: rgba(252, 165, 165, 0.95);
}

.edit-status {
    border-radius: 10px;
    padding: 0.8rem 0.95rem;
    margin-bottom: 1rem;
    font-size: 0.82rem;
    line-height: 1.45;
    border: 1px solid transparent;
}

.edit-status.info {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.22);
    color: rgba(147, 197, 253, 0.95);
}

.edit-status.success {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.24);
    color: rgba(110, 231, 183, 0.95);
}

.edit-status.warning {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.24);
    color: rgba(253, 230, 138, 0.95);
}

.edit-status.error {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.24);
    color: rgba(252, 165, 165, 0.95);
}

.alert {
    padding: 0.85rem 1rem;
    border-radius: 10px;
    margin-bottom: 1.25rem;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.alert-info {
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: rgba(96, 165, 250, 0.85);
    font-size: 0.82rem;
    line-height: 1.5;
}

.alert svg { flex-shrink: 0; margin-top: 1px; }

.form-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; }

.btn-secondary {
    padding: 11px 22px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.65);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.18);
}

.btn-primary {
    flex: 1;
    padding: 11px 22px;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 10px;
    color: #c4b5fd;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-primary:hover:not(:disabled) {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.6);
    box-shadow: 0 4px 18px rgba(139, 92, 246, 0.25);
}

.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

@keyframes slideUp {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-hero .gradient-text { font-size: 2.2rem; }
    .dashboard-hero .hero-subtitle { font-size: 0.95rem; }
    .wallet-disconnected, .wallet-connected { padding: 12px 18px; font-size: 0.88rem; }
    .connect-card { padding: 2.5rem 1.5rem; }
    .connect-card h3 { font-size: 1.4rem; }
    .gallery-toolbar { flex-direction: column; align-items: stretch; }
    .toolbar-stats { margin-right: 0; }
    .toolbar-search { width: 100%; }
    .toolbar-filters { flex-wrap: wrap; }
    .nft-gallery { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.85rem; }
    .nft-info { padding: 0.75rem 0.85rem 0.85rem; }
    .nft-card-name { font-size: 0.88rem; }
    .modal-dialog { width: 96%; }
    .form-actions { flex-direction: column; }
    .btn-secondary, .btn-primary { width: 100%; }
}

@media (max-width: 480px) {
    .nft-gallery { grid-template-columns: repeat(2, 1fr); gap: 0.65rem; }
    .nft-card-header { flex-direction: column; gap: 0.35rem; }
    .nft-origin-badge { align-self: flex-start; }
}
