:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg-light: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
    touch-action: manipulation;
}

body {
    background: radial-gradient(circle at top right, #e0e7ff, transparent),
        radial-gradient(circle at bottom left, #fef3c7, transparent),
        #f8fafc;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    color: var(--text-main);
    line-height: 1.5;
}

.container {
    max-width: 500px;
    margin: 0 auto;
}

/* Glass Card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
    transition: transform 0.2s ease;
}

/* Full Screen Layout for Token Page */
.full-screen-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: none;
    border-radius: 0;
    padding: 16px;
    box-shadow: none;
    margin-bottom: 0;
    min-height: 100vh;
    width: 100%;
}

/* Header Sections */
.page-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--primary);
    text-align: center;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 32px;
    text-align: center;
}

/* Link Grid */
.link-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}

.link-btn {
    padding: 8px 4px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.75rem;
    text-align: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    width: 100%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.link-btn-indigo {
    background: #e0e7ff;
    color: #4338ca;
}

.link-btn-emerald {
    background: #d1fae5;
    color: #065f46;
}

.link-btn-orange {
    background: #ffedd5;
    color: #9a3412;
}

.link-btn:hover {
    transform: translateY(-2px);
    filter: brightness(0.95);
}

.pulse-btn {
    position: relative;
    overflow: hidden;
}

.pulse-btn:after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: translateX(-100%);
}

.pulse-btn:hover:after {
    animation: shine 1.5s infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* Fields & Inputs */
.field {
    margin-bottom: 12px;
}

.field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.field input,
.field textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
    background: #fff;
    transition: all 0.2s;
    outline: none;
}

.field input:focus,
.field textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.field input[readonly] {
    background: #f1f5f9;
    cursor: pointer;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 14px;
    font-size: 0.9375rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: scale(1.02);
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover {
    background: #059669;
    transform: scale(1.02);
}

.btn-warning {
    background: var(--warning);
    color: #fff;
}

.btn-warning:hover {
    background: #d97706;
    transform: scale(1.02);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Account Info Card */
.acc-card {
    background: #fff;
    border-radius: 20px;
    padding: 20px;
    border: 1px solid #f1f5f9;
    margin: 20px 0;
}

.acc-card-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Animations & Effects */
.blur-text {
    color: transparent;
    text-shadow: 0 0 8px rgba(30, 41, 59, 0.6);
    transition: text-shadow 0.2s;
}

.blur-text:hover {
    text-shadow: 0 0 0px var(--text-main);
}

#toast {
    position: fixed;
    top: 24px;
    right: 24px;
    transform: translateX(120%);
    background: #1e293b;
    color: #fff;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#toast.show {
    transform: translateX(0);
    opacity: 1;
}

/* Admin Specific */
.admin-card {
    border-top: 4px solid var(--primary);
}

.token-item {
    border-left: 4px solid var(--primary);
    padding-left: 16px;
    margin-bottom: 24px;
}

.badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .glass-card {
        padding: 24px 20px;
    }
}

/* Wide Layout for Token Page */
.container-wide {
    max-width: 100%;
    margin: 0;
    width: 100%;
    padding: 0;
}

.triple-grid {
    display: block;
    width: 100%;
}


.webview-container {
    height: 85vh;
    min-height: 600px;
    padding: 0 !important;
    overflow: hidden;
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.webview-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
}

.open-app-card {
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-align: center;
}

.btn-large {
    height: 120px;
    font-size: 1.5rem !important;
    flex-direction: column;
    gap: 8px;
    border-radius: 20px;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    box-shadow: 0 10px 20px -5px rgba(99, 102, 241, 0.5);
}

.btn-large:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 25px -5px rgba(99, 102, 241, 0.6);
}

.deeplink-box {
    margin-top: 20px;
    text-align: left;
}

.deeplink-box label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    display: block;
    margin-bottom: 5px;
}

.deeplink-box textarea {
    width: 100%;
    height: 120px;
    font-size: 0.75rem;
    font-family: monospace;
    padding: 10px;
    border-radius: 12px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    resize: none;
}

@media (max-width: 1200px) {
    .triple-grid {
        grid-template-columns: 1fr;
    }

    .webview-container {
        height: 500px;
    }
}