/* ===================================================
   Himaya QR Card — main.css
   Mobile-first, max 420px card centered on dark bg
=================================================== */

:root {
    --bg:            #0A0E17;
    --surface:       #111827;
    --surface-alt:   #1A2236;
    --border:        #1E2D45;
    --border-gold:   rgba(201, 168, 76, 0.25);
    --accent:        #C9A84C;
    --accent-hover:  #E0BF6A;
    --text:          #E8EBF0;
    --text-muted:    #8A97A8;
    --heading:       #FFFFFF;
    --danger:        #C0392B;
    --success:       #27AE60;
    --font-heading:  'Cormorant Garamond', Georgia, serif;
    --font-body:     'Inter', system-ui, sans-serif;
    --radius:        10px;
    --radius-sm:     6px;
    --transition:    0.25s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Top Bar ─────────────────────────────────── */

.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: rgba(10, 14, 23, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.top-bar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.top-bar-logo-img {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.top-bar-wordmark {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.top-bar-name {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--heading);
    letter-spacing: 0.04em;
}

.top-bar-sub {
    font-size: 9px;
    font-weight: 500;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.share-btn {
    background: rgba(201, 168, 76, 0.1);
    border: 1px solid var(--border-gold);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--accent);
    font-size: 20px;
    transition: var(--transition);
    flex-shrink: 0;
}

.share-btn:hover {
    background: rgba(201, 168, 76, 0.2);
    border-color: var(--accent);
}

/* ── Page Layout ─────────────────────────────── */

.card-page {
    max-width: 420px;
    margin: 0 auto;
    padding: 88px 20px 60px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ── Profile Section ─────────────────────────── */

.profile-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 32px 24px 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    gap: 6px;
    position: relative;
    overflow: hidden;
}

.profile-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.avatar-wrapper {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    padding: 3px;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--surface-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--text-muted);
}

.profile-name {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 700;
    color: var(--heading);
    line-height: 1.2;
    margin-top: 4px;
}

.profile-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 2px;
}

.profile-bio {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
    max-width: 280px;
}

.btn-save-contact {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    background: var(--accent);
    color: var(--bg);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 12px 24px;
    border-radius: 4px;
    text-decoration: none;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    width: 100%;
    justify-content: center;
}

.btn-save-contact:hover {
    background: var(--accent-hover);
}

.btn-save-contact i {
    font-size: 16px;
}

/* ── Links Section ───────────────────────────── */

.links-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.link-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    text-decoration: none;
    color: var(--text);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.link-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent);
    transform: scaleY(0);
    transition: transform 0.3s ease;
    transform-origin: center;
}

.link-card:hover::before {
    transform: scaleY(1);
}

.link-card:hover {
    border-color: var(--border-gold);
    transform: translateX(3px);
}

.link-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--accent);
    flex-shrink: 0;
}

.link-label {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.link-arrow {
    font-size: 16px;
    color: var(--text-muted);
    transition: var(--transition);
}

.link-card:hover .link-arrow {
    color: var(--accent);
    transform: translateX(2px);
}

/* ── QR Section ──────────────────────────────── */

.qr-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 28px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
    margin-top: 4px;
}

.qr-image {
    width: 160px;
    height: 160px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: #fff;
    padding: 8px;
}

.qr-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ── QR Share Modal ──────────────────────────── */

.qr-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.qr-modal.is-open {
    pointer-events: all;
    opacity: 1;
}

.qr-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 14, 23, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.qr-modal-content {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius);
    padding: 32px 28px;
    max-width: 320px;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transform: translateY(16px) scale(0.96);
    transition: transform 0.3s ease, opacity 0.25s ease;
    opacity: 0;
}

.qr-modal.is-open .qr-modal-content {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.qr-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 16px;
    transition: var(--transition);
}

.qr-modal-close:hover {
    color: var(--heading);
    border-color: var(--text-muted);
}

.qr-modal-title {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    color: var(--heading);
    margin-top: 8px;
}

.qr-modal-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.qr-modal-image {
    width: 200px;
    height: 200px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: #fff;
    padding: 10px;
    margin: 4px 0;
}

.qr-modal-placeholder {
    width: 200px;
    height: 200px;
    background: var(--surface-alt);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 12px;
    margin: 4px 0;
}

.qr-modal-placeholder i {
    font-size: 40px;
}

.qr-modal-url {
    font-size: 11px;
    color: var(--text-muted);
    word-break: break-all;
}

/* ── Page Footer ─────────────────────────────── */

.page-footer {
    text-align: center;
    padding: 20px 0 8px;
    font-size: 11px;
    color: var(--text-muted);
}

.page-footer a {
    color: var(--text-muted);
    text-decoration: none;
}

.page-footer a:hover {
    color: var(--accent);
}

/* ── Admin Styles ────────────────────────────── */

.admin-body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 14px;
    min-height: 100vh;
    display: flex;
}

/* Sidebar */
.admin-sidebar {
    width: 220px;
    min-height: 100vh;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
}

.admin-sidebar-logo {
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.admin-sidebar-logo-name {
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 700;
    color: var(--heading);
    letter-spacing: 0.04em;
    line-height: 1.2;
}

.admin-sidebar-logo-badge {
    font-size: 10px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.admin-sidebar-nav {
    padding: 16px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
}

.admin-nav-link i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.admin-nav-link:hover {
    background: var(--surface-alt);
    color: var(--text);
}

.admin-nav-link.active {
    background: rgba(201, 168, 76, 0.12);
    color: var(--accent);
}

.admin-nav-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

.admin-nav-logout {
    color: #c0392b;
}

.admin-nav-logout:hover {
    background: rgba(192, 57, 43, 0.1);
    color: #e74c3c;
}

.admin-sidebar-version {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-muted);
}

/* Main content area */
.admin-main {
    margin-left: 220px;
    flex: 1;
    padding: 32px 28px;
    max-width: calc(100% - 220px);
}

.admin-page-title {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 700;
    color: var(--heading);
    margin-bottom: 24px;
}

.admin-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}

.admin-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

/* Form elements */
.form-group {
    margin-bottom: 16px;
}

.form-group:last-child {
    margin-bottom: 0;
}

label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="password"],
textarea,
select {
    width: 100%;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 14px;
    transition: var(--transition);
    outline: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.1);
}

select option {
    background: var(--surface);
    color: var(--text);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.form-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
}

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

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

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    color: var(--text);
    border-color: var(--text-muted);
}

.btn-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid rgba(192, 57, 43, 0.35);
}

.btn-danger:hover {
    background: rgba(192, 57, 43, 0.1);
}

.btn-sm {
    padding: 7px 14px;
    font-size: 11px;
}

/* Image preview */
.image-preview-wrap {
    margin-top: 8px;
}

.image-preview {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    display: block;
}

.image-preview-empty {
    width: 80px;
    height: 80px;
    background: var(--surface-alt);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
}

.image-preview-empty i {
    font-size: 22px;
}

/* Link cards in admin */
.link-admin-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.link-admin-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
}

.link-admin-icon {
    font-size: 18px;
    color: var(--accent);
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.link-admin-info {
    flex: 1;
    min-width: 0;
}

.link-admin-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-admin-url {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-admin-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.link-active-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.link-active-badge.on {
    background: rgba(39, 174, 96, 0.15);
    color: var(--success);
}

.link-active-badge.off {
    background: rgba(138, 151, 168, 0.1);
    color: var(--text-muted);
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-success {
    background: rgba(39, 174, 96, 0.1);
    border: 1px solid rgba(39, 174, 96, 0.3);
    color: var(--success);
}

.alert-error {
    background: rgba(192, 57, 43, 0.1);
    border: 1px solid rgba(192, 57, 43, 0.3);
    color: var(--danger);
}

/* Login page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 24px;
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px 32px;
    width: 100%;
    max-width: 360px;
}

.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-bottom: 28px;
    text-align: center;
}

.login-logo-name {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    color: var(--heading);
    letter-spacing: 0.05em;
}

.login-logo-badge {
    font-size: 10px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.login-error {
    background: rgba(192, 57, 43, 0.1);
    border: 1px solid rgba(192, 57, 43, 0.3);
    color: var(--danger);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 16px;
    text-align: center;
}

/* Toggle switch */
.toggle-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-switch {
    position: relative;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-track {
    position: absolute;
    inset: 0;
    background: var(--border);
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.toggle-track::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: var(--transition);
}

.toggle-switch input:checked + .toggle-track {
    background: var(--accent);
}

.toggle-switch input:checked + .toggle-track::after {
    transform: translateX(16px);
}

.toggle-label {
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
}

/* Dashboard stat cards */
.admin-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.admin-stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-decoration: none;
    transition: var(--transition);
}

.admin-stat-card:hover {
    border-color: var(--border-gold);
}

.admin-stat-icon {
    font-size: 28px;
    color: var(--accent);
    margin-bottom: 8px;
    display: block;
}

.admin-stat-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
}

.admin-stat-value {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    color: var(--heading);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}
