:root {
    --bg-color: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --primary-color: #3b82f6;
    --border-radius-lg: 24px;
    --border-radius-md: 16px;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

body {
    margin: 0;
    font-family: 'Kanit', system-ui, -apple-system, sans-serif;
    font-weight: 300;
    background-color: var(--bg-color);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm);
}

.theme-glass {
    background: linear-gradient(135deg, #e0eafc 0%, #cfdef3 100%);
    min-height: 100vh;
}

/* App Container (Mobile First) */
.app-container {
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    padding-bottom: 2rem;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 40px rgba(0,0,0,0.05);
}

/* Cover Photo */
.cover-photo {
    width: 100%;
    height: 240px;
    position: relative;
    z-index: 1;
}

.cover-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Content Wrapper */
.content-wrapper {
    position: relative;
    z-index: 2;
    padding: 0 24px;
    margin-top: -60px; /* Pull up over cover photo */
}

/* Profile Header */
.profile-header {
    text-align: center;
    margin-bottom: 32px;
}

.profile-avatar-wrapper {
    width: 120px;
    height: 120px;
    margin: 0 auto 16px;
    border-radius: 50%;
    padding: 6px;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
}

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

.profile-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--text-primary);
}

.profile-bio {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
    white-space: pre-line;
}

/* Sections */
.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 16px 0;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.links-section, .promotions-section {
    margin-bottom: 40px;
}

/* Links Grid */
.links-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.link-card {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: var(--border-radius-md); /* a bit smaller radius looks better in 2 cols */
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.link-card:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: var(--shadow-md);
    background: rgba(255, 255, 255, 0.9);
}

.link-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    color: var(--primary-color);
    flex-shrink: 0;
}

.link-icon .icon {
    width: 100%;
    height: 100%;
}

.link-name {
    flex: 1;
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
    margin-right: 40px; /* Balance the icon width+margin to perfectly center the text */
}

/* Swiper Promotions */
.promotions-swiper {
    padding-bottom: 40px;
}

.swiper-pagination-bullet-active {
    background-color: var(--primary-color) !important;
}

.promo-card {
    border-radius: var(--border-radius-md);
    overflow: hidden;
    position: relative;
    aspect-ratio: 4/5;
    transition: transform 0.3s ease;
    cursor: pointer;
}

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

.promo-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.promo-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 12px 12px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
}

.promo-info h3 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Gallery Grid */
.gallery-section {
    margin-bottom: 40px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.gallery-item {
    border-radius: var(--border-radius-md);
    overflow: hidden;
    aspect-ratio: 1; /* Square thumbnails */
    cursor: pointer;
    transition: transform 0.3s ease;
    position: relative;
}

.gallery-item:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-md);
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

/* Admin / Login Styles specific */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}
.login-container {
    padding: 2rem;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    background: white;
    box-shadow: var(--shadow-md);
}
.w-full { width: 100%; }
.error-msg { background: #fee2e2; color: #dc2626; padding: 0.75rem; border-radius: 6px; margin-bottom: 1rem; }

/* Lightbox Modal */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.lightbox-content {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    animation: zoomIn 0.3s ease;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    transition: color 0.3s;
}

.lightbox-close:hover {
    color: var(--primary-color);
}

@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Promo Popup */
.popup-box {
    background: white;
    padding: 24px;
    border-radius: var(--border-radius-lg);
    max-width: 90%;
    width: 400px;
    text-align: center;
    position: relative;
    animation: zoomIn 0.3s ease;
    color: var(--text-primary);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.popup-btn-close {
    background: var(--text-primary);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
}

.popup-btn-close:hover {
    background: #333;
}

.popup-image {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 10px;
}

.popup-text {
    margin-top: 16px;
    font-size: 1rem;
    line-height: 1.5;
    white-space: pre-line;
}

/* Floating contact bar */
.floating-bar {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.floating-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
}

.floating-btn:hover {
    transform: scale(1.08);
}

.floating-btn.map { background: #ef4444; }
.floating-btn.phone { background: #10b981; }
.floating-btn.line { background: #06c755; }
.floating-btn.share { background: var(--text-primary); }

/* Lightbox navigation */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: none;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10000;
    transition: background 0.2s;
}

.lightbox-nav:hover { background: rgba(255, 255, 255, 0.3); }
.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }

.lightbox-counter {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
    background: rgba(0, 0, 0, 0.4);
    padding: 4px 12px;
    border-radius: 999px;
    z-index: 10000;
}

/* Promotion countdown */
.promo-countdown {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.55);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    z-index: 2;
    letter-spacing: 0.02em;
}

/* Share-link toast */
.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(20px);
    background: var(--text-primary);
    color: white;
    font-size: 0.85rem;
    padding: 10px 20px;
    border-radius: 999px;
    box-shadow: var(--shadow-md);
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
    z-index: 10001;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
