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

body {
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    background: #f5f6fa;
    color: #1a1a1a;
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; }

/* ===== صفحات الدخول والتسجيل ===== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6C5CE7, #A29BFE);
    padding: 20px;
}
.auth-box {
    background: #fff;
    padding: 40px 32px;
    border-radius: 16px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}
.auth-box h1 { text-align: center; color: #6C5CE7; font-size: 28px; }
.auth-logo { display: block; margin: 0 auto; max-width: 200px; height: auto; }
.auth-box .subtitle { text-align: center; color: #888; margin-bottom: 24px; }
.auth-box label { display: block; font-size: 13px; margin: 14px 0 6px; color: #444; }
.auth-box input {
    width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px;
}
.auth-box button {
    width: 100%; margin-top: 20px; padding: 13px; background: #6C5CE7; color: #fff;
    border: none; border-radius: 8px; font-size: 15px; cursor: pointer; font-weight: bold;
}
.auth-box button:hover { background: #5849c4; }
.switch { text-align: center; margin-top: 18px; font-size: 14px; color: #666; }
.switch a { color: #6C5CE7; font-weight: bold; }
.alert { background: #ffe3e3; color: #c0392b; padding: 10px; border-radius: 8px; margin-bottom: 10px; font-size: 14px; }
.alert-success { background: #d4f8e0; color: #1e7d3e; }
.link-preview { background: #f0f0ff; padding: 8px 12px; border-radius: 6px; font-size: 13px; color: #6C5CE7; margin-bottom: 8px; word-break: break-all; }

/* ===== الداشبورد ===== */
.topbar {
    background: #fff; padding: 14px 24px; display: flex; justify-content: space-between; align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05); position: sticky; top: 0; z-index: 10;
}
.logo { font-weight: bold; font-size: 20px; color: #6C5CE7; }
.logo-img { height: 34px; width: auto; display: block; }
.topbar-actions { display: flex; gap: 10px; }
.btn-outline {
    border: 1px solid #6C5CE7; color: #6C5CE7; padding: 8px 16px; border-radius: 8px; font-size: 13px;
}
.btn-outline:hover { background: #6C5CE7; color: #fff; }

.dash-grid { display: grid; grid-template-columns: 1fr 380px; gap: 24px; max-width: 1200px; margin: 24px auto; padding: 0 20px; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } .preview-panel { order: -1; } }

.card { background: #fff; border-radius: 14px; padding: 20px; margin-bottom: 18px; box-shadow: 0 2px 10px rgba(0,0,0,0.04); }
.card h3 { margin-bottom: 14px; font-size: 16px; }
.card input { width: 100%; padding: 10px; border: 1px solid #e0e0e0; border-radius: 8px; margin-bottom: 10px; font-size: 14px; }
.card button { padding: 10px 20px; background: #6C5CE7; color: #fff; border: none; border-radius: 8px; cursor: pointer; font-weight: bold; }
.hint { font-size: 12px; color: #999; margin-bottom: 10px; }
.avatar-upload-row { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.avatar-preview { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 1px solid #eee; }
.avatar-pick-btn { cursor: pointer; }

.links-list { list-style: none; }
.links-list li {
    display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid #eee; border-radius: 10px; margin-bottom: 8px; cursor: grab;
}
.links-list li.inactive { opacity: 0.45; }
.drag-handle { color: #ccc; cursor: grab; }
.link-info { flex: 1; overflow: hidden; }
.link-info strong { display: block; font-size: 14px; }
.link-info small { color: #999; font-size: 11px; word-break: break-all; }
.inline-form { display: inline; }
.icon-btn { background: none; border: none; cursor: pointer; font-size: 16px; padding: 4px; }

.theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.theme-option {
    border: 2px solid #eee; border-radius: 10px; padding: 12px; text-align: center; cursor: pointer; font-size: 13px; position: relative;
}
.theme-option input { display: none; }
.theme-option.selected { border-color: #6C5CE7; background: #f5f3ff; }
.theme-option.theme-minimal { background: #fff; }
.theme-option.theme-dark { background: #1e1e2e; color: #fff; }
.theme-option.theme-gradient { background: linear-gradient(135deg,#667eea,#764ba2); color: #fff; }
.theme-option.theme-sunset { background: linear-gradient(135deg,#ff9966,#ff5e62); color: #fff; }
.theme-option.theme-diamond { background: radial-gradient(ellipse at 50% -10%, #141210 0%, #0b0a08 55%); color: #c99a3d; border-color: rgba(201,154,61,.4); }
.theme-option.theme-aurora { background: linear-gradient(125deg, #1a1035, #0d1f3d, #0a2e2a); color: #bda9ff; }
.theme-option.theme-bioluminescence { background: radial-gradient(ellipse at 50% 100%, #051426, #020814 70%); color: #3ddad7; }
.theme-option.theme-mosaic { background: linear-gradient(160deg, #f4ede0, #ede2cf); color: #0f6e5c; border-color: rgba(15,110,92,.3); }
.theme-option.theme-brutalist { background: #f5f5f0; color: #111; border: 2px solid #111; border-radius: 6px; }
.theme-option.theme-origami { background: linear-gradient(170deg, #faf6ee, #f2ead9); color: #c97b5a; }
.theme-option.theme-blocks { background: #fff; color: #5b4cf0; border-color: #ecebfd; }
.theme-option.theme-mesh { background: linear-gradient(135deg, #ff9ecb, #a78bfa, #7dd3fc); color: #fff; }
.theme-option.theme-neumorphic { background: #eef1f5; color: #3a3f4a; box-shadow: inset 2px 2px 5px rgba(0,0,0,.08), inset -2px -2px 5px rgba(255,255,255,.9); }
.theme-option.theme-list { background: #fff; color: #2563eb; border-bottom: 2px solid #eee; }
.theme-option.theme-duotone { background: linear-gradient(160deg, #1a1a2e, #ff6b6b); color: #fff; }

.stats-card p { font-size: 15px; }
.verified-status { color: #1e7d3e; font-weight: bold; font-size: 14px; }

.share-card-body { display: flex; align-items: center; gap: 16px; margin-top: 12px; }
.qr-img-small { border-radius: 8px; border: 1px solid #eee; flex-shrink: 0; }
.share-card-actions { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.share-card-actions .btn-outline { text-align: center; cursor: pointer; background: none; font-family: inherit; }

.preview-panel { display: flex; justify-content: center; align-items: flex-start; padding-top: 10px; }
.phone-frame {
    width: 320px; height: 640px; background: #111; border-radius: 36px; padding: 12px; box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}
.phone-frame iframe { width: 100%; height: 100%; border: none; border-radius: 26px; background: #fff; }

/* ===== الصفحة العامة (البروفايل) ===== */
.profile-page { min-height: 100vh; display: flex; justify-content: center; padding: 50px 16px; }
.profile-container { width: 100%; max-width: 480px; text-align: center; }
.avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; margin-bottom: 16px; border: 3px solid rgba(255,255,255,0.5); }
.display-name { font-size: 22px; margin-bottom: 6px; }
.verified-badge { vertical-align: middle; margin-right: 4px; display: inline-block; }
.bio { font-size: 14px; opacity: 0.85; margin-bottom: 28px; }
.links-container { display: flex; flex-direction: column; gap: 12px; }
.profile-link {
    display: block; padding: 15px; border-radius: 12px; font-weight: 600; font-size: 15px;
    transition: transform 0.15s;
}
.profile-link:hover { transform: scale(1.02); }
.no-links { opacity: 0.6; font-size: 14px; }
.powered-by { margin-top: 40px; font-size: 12px; opacity: 0.6; }
.powered-by a { text-decoration: underline; }

/* زرار المشاركة (سهم) */
.share-btn {
    position: fixed; top: 18px; inset-inline-end: 18px;
    width: 38px; height: 38px; border-radius: 50%;
    background: rgba(0,0,0,0.08); border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: inherit; backdrop-filter: blur(6px);
    z-index: 20;
}
.share-btn:hover { background: rgba(0,0,0,0.15); }

/* نافذة المشاركة */
.share-modal {
    display: none;
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    width: 100%; height: 100%; height: 100dvh;
    background: rgba(0,0,0,0.55);
    align-items: center; justify-content: center;
    z-index: 999; padding: 20px;
}
.share-modal.open { display: flex; }
.share-modal-box {
    background: #fff; color: #1a1a1a; border-radius: 18px; padding: 28px 24px 24px;
    max-width: 300px; width: 100%; text-align: center; position: relative;
}
.share-close { position: absolute; top: 12px; left: 14px; background: none; border: none; font-size: 16px; cursor: pointer; color: #888; }
.qr-img { border-radius: 10px; margin-bottom: 20px; border: 1px solid #eee; }
.share-option-row { display: flex; gap: 10px; }
.share-option-btn {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 14px 8px; background: #f5f5f7; border: 1px solid #eee; border-radius: 12px;
    cursor: pointer; font-size: 12.5px; font-family: inherit; color: #1a1a1a;
}
.share-option-btn:hover { background: #ececf1; }
