:root {
    --primary: #FF9F1C;
    --secondary: #2EC4B6;
    --accent: #E71D36;
    --dark: #011627;
    --light: #FDFFFC;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Hind', sans-serif;
    background-color: var(--dark);
    color: var(--light);
    min-height: 100vh;
    padding: 1.5rem;
    overflow-x: hidden;
}

.background-blobs {
    position: fixed; inset: 0; z-index: -1;
    background: radial-gradient(at 0% 0%, rgba(46, 196, 182, 0.1) 0px, transparent 50%),
                radial-gradient(at 100% 100%, rgba(255, 159, 28, 0.1) 0px, transparent 50%);
    pointer-events: none;
}

.container { max-width: 1200px; margin: 0 auto; }

/* Header */
header { display: flex; flex-direction: column; margin-bottom: 2rem; }
.header-top { display: flex; align-items: center; justify-content: space-between; }
.logo-title {
    font-family: 'Playfair Display', serif; font-size: 2.2rem;
    background: linear-gradient(135deg, #fff, var(--secondary));
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.subtitle { font-size: 0.95rem; opacity: 0.7; text-align: right; }

.back-btn {
    display: flex; align-items: center; gap: 0.5rem; text-decoration: none;
    color: var(--light); font-weight: 500;
    padding: 0.6rem 1.2rem; background: var(--glass-bg);
    border: 1px solid var(--glass-border); border-radius: 30px;
    backdrop-filter: blur(8px); transition: var(--transition);
}
.back-btn:hover { background: rgba(255,255,255,0.1); transform: translateX(-5px); }

/* Layout */
.post-layout {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 2rem;
    align-items: start;
}
@media (max-width: 800px) { .post-layout { grid-template-columns: 1fr; } }

.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    backdrop-filter: blur(12px);
    box-shadow: var(--glass-shadow);
}
.p-4 { padding: 1.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.w-100 { width: 100%; }

.section-title { font-size: 1.2rem; display: flex; align-items: center; gap: 0.5rem; color: var(--secondary); margin-bottom: 1rem; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 0.5rem;}

/* Forms */
.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; font-size: 0.85rem; opacity: 0.8; margin-bottom: 0.4rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.form-control {
    width: 100%; padding: 0.8rem 1rem;
    background: rgba(0,0,0,0.2); border: 1px solid var(--glass-border);
    border-radius: 12px; color: var(--light); font-size: 1rem; outline: none; transition: var(--transition);
}
.form-control:focus { border-color: var(--secondary); background: rgba(0,0,0,0.3); }

.search-box {
    display: flex; align-items: center; background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border); border-radius: 12px;
    padding: 0.3rem 1rem; transition: var(--transition);
}
.search-box:focus-within { border-color: var(--secondary); }
.search-box input { flex: 1; border: none; background: transparent; padding: 0.6rem 0; color: white; outline: none; }
.search-icon { color: var(--secondary); margin-right: 0.8rem; font-size: 18px; }

/* Member List & Card */
.position-relative { position: relative; }
.member-list {
    position: absolute; top: calc(100% - 0.5rem); left: 0; right: 0; z-index: 50;
    max-height: 200px; overflow-y: auto; background: var(--dark);
    border: 1px solid var(--glass-border); border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.member-list.hide { display: none; }
.list-item {
    padding: 0.8rem 1rem; display: flex; align-items: center; gap: 0.8rem;
    cursor: pointer; border-bottom: 1px solid rgba(255,255,255,0.05); transition: background 0.2s;
}
.list-item:hover { background: rgba(255,255,255,0.1); }
.list-item img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.list-item .name { font-weight: 500; font-size: 0.95rem; }
.list-item .desc { font-size: 0.75rem; opacity: 0.6; }

/* Senders UI */
.selected-senders-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.sender-chip { display: flex; align-items: center; gap: 0.4rem; background: rgba(255,255,255,0.1); border: 1px solid var(--glass-border); padding: 0.3rem 0.6rem 0.3rem 0.3rem; border-radius: 20px; font-size: 0.8rem; }
.sender-chip img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.sender-chip button { background: none; border: none; color: white; opacity: 0.6; cursor: pointer; display: flex; align-items: center; }
.sender-chip button:hover { opacity: 1; color: var(--accent); }

.selected-member-card {
    display: flex; align-items: center; gap: 1rem; padding: 0.8rem;
    background: rgba(46,196,182,0.1); border: 1px solid var(--secondary);
    border-radius: 12px; margin-top: 0.5rem;
}
.selected-member-card.hide { display: none; }
.s-img img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid var(--secondary); }
.font-bold { font-weight: 600; font-size: 1rem; }
.text-xs { font-size: 0.75rem; } .text-muted { opacity: 0.7; }
.icon-btn { background: none; border: none; color: white; opacity: 0.6; cursor: pointer; margin-left: auto; padding: 0.5rem; border-radius: 50%; transition: 0.2s; }
.icon-btn:hover { background: rgba(255,255,255,0.1); opacity: 1; }

.btn-primary {
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    background: linear-gradient(135deg, var(--secondary) 0%, #17A094 100%);
    color: white; border: none; padding: 1rem; border-radius: 12px;
    font-weight: 600; font-size: 1rem; cursor: pointer; transition: transform 0.2s;
}
.btn-primary:not(:disabled):hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(46,196,182,0.4); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; filter: grayscale(1); }

/* Events */
.loader-small { width: 20px; height: 20px; border: 2px solid rgba(255,255,255,0.2); border-top-color: var(--secondary); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto; }
@keyframes spin { 100% { transform: rotate(360deg); } }

.event-item {
    display: flex; align-items: center; gap: 0.8rem; padding: 0.8rem;
    background: rgba(255,255,255,0.03); border-radius: 10px; margin-bottom: 0.5rem; cursor: pointer; transition: 0.2s; border: 1px solid transparent;
}
.event-item:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.1); }
.e-icon { font-size: 1.5rem; }
.e-name { font-weight: 500; font-size: 0.95rem; }
.e-type { font-size: 0.75rem; opacity: 0.7; }
.text-center { text-align: center; font-size: 0.85rem; opacity: 0.6; }

/* Tabs & Previews */
.tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.tab-btn {
    flex: 1; padding: 0.8rem; background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: 12px; color: white; display: flex; align-items: center; justify-content: center;
    gap: 0.5rem; cursor: pointer; font-weight: 600; transition: 0.2s; opacity: 0.7;
}
.tab-btn.active { opacity: 1; background: rgba(46,196,182,0.15); border-color: var(--secondary); color: var(--secondary); }

.tab-content { display: none; }
.tab-content.active { display: block; animation: fade 0.3s; }
.hide { display: none !important; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* Theme Chips UI */
.theme-chips-container { display: flex; gap: 0.5rem; align-items: center; }
.theme-chip { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.2); cursor: pointer; transition: 0.2s; box-shadow: 0 2px 5px rgba(0,0,0,0.5); }
.theme-chip:hover { transform: scale(1.1); }
.theme-chip.active { border-color: #FFD700; transform: scale(1.15); box-shadow: 0 0 8px rgba(255,215,0,0.6); }

.view-card { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 16px; padding: 1.5rem; }
.copy-header { display: flex; justify-content: space-between; align-items: center; font-weight: 600; margin-bottom: 1rem; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 0.8rem;}

.action-btn { display: flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.8rem; background: rgba(255,255,255,0.1); border: none; border-radius: 8px; color: white; cursor: pointer; font-size: 0.8rem; transition: 0.2s; }
.action-btn:hover { background: var(--secondary); }

.post-textarea {
    width: 100%; min-height: 250px; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px; padding: 1rem; color: #fff; line-height: 1.6; font-size: 1rem; font-family: inherit; resize: vertical;
}

/* Visibility Toggles */
.visibility-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1rem;
}
.toggle-switch {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    user-select: none;
    font-size: 0.9rem;
    color: var(--light);
}
.toggle-switch input { display: none; }
.slider {
    position: relative;
    width: 34px;
    height: 18px;
    background-color: rgba(255,255,255,0.1);
    border-radius: 20px;
    transition: .3s;
    border: 1px solid var(--glass-border);
}
.slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: .3s;
}
input:checked + .slider { background-color: var(--secondary); }
input:checked + .slider:before { transform: translateX(16px); }

/* Card Element Visibility Control */
.hide { display: none !important; }

/* Graphic Card Styles (Export Target) */
.card-wrap-export { 
    display: flex; justify-content: center; padding: 1rem 0; width: 100%;
}

.graphic-card {
    position: relative; aspect-ratio: 4/5; width: 100%; max-width: 450px; margin: 0 auto;
    background-size: cover; background-position: center;
    display: flex; flex-direction: column; text-align: center; color: white; padding: 2.5rem 2rem;
    font-family: 'Hind', sans-serif;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4); 
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1); 
    transition: transform 0.3s ease;
}
.graphic-card:hover { transform: translateY(-5px); box-shadow: 0 25px 50px rgba(0,0,0,0.6); }

/* General Announcement Styles */
.general-layout .g-photo-frame { width: 90px; height: 90px; margin-bottom: 1rem; }
.general-layout .g-title { font-size: 1.8rem; margin-bottom: 1.2rem; }
.general-layout .g-message { font-size: 1.1rem; line-height: 1.8; font-weight: 500; }
.general-layout.no-member .g-photo-frame, 
.general-layout.no-member .g-name, 
.general-layout.no-member .g-father { display: none; }
.general-layout.no-member .g-body { display: flex; flex-direction: column; justify-content: center; height: 100%; }


/* Themes - Pattern: 1:Pastel, 2:Light, 3:Dark, 4:Vibrant, 5:Premium */

/* Birthday 🎂 */
.birthday-theme-1 { background: linear-gradient(135deg, #FF9A9E 0%, #FECFEF 100%); }
.birthday-theme-2 { background: linear-gradient(135deg, #FFC371 0%, #FF5F6D 100%); }
.birthday-theme-3 { background: linear-gradient(135deg, #8E2DE2 0%, #4A00E0 100%); }
.birthday-theme-4 { background: linear-gradient(135deg, #FF4B2B 0%, #FF416C 100%); }
.birthday-theme-5 { background: linear-gradient(135deg, #FAD961 0%, #F76B1C 100%); }

/* Anniversary 💍 */
.anniv-theme-1 { background: linear-gradient(135deg, #E29587 0%, #D66D75 100%); }
.anniv-theme-2 { background: linear-gradient(135deg, #FFD194 0%, #70E1F5 100%); }
.anniv-theme-3 { background: linear-gradient(135deg, #15000B 0%, #6A1143 100%); }
.anniv-theme-4 { background: linear-gradient(135deg, #DA22FF 0%, #9733EE 100%); }
.anniv-theme-5 { background: linear-gradient(135deg, #B8860B 0%, #2E1503 100%); }

/* Tribute 🕊️ (Strictly Respectful) */
.tribute-theme-1 { background: linear-gradient(135deg, #bdc3c7 0%, #2c3e50 100%); }
.tribute-theme-2 { background: linear-gradient(135deg, #606c88 0%, #3f4c6b 100%); }
.tribute-theme-3 { background: linear-gradient(to bottom, #141E30, #243B55); }
.tribute-theme-4 { background: linear-gradient(to bottom, #2C3E50, #000000); }
.tribute-theme-5 { background: linear-gradient(135deg, #3E2723 0%, #1B0000 100%); }

/* General ✨ */
.general-theme-1 { background: linear-gradient(135deg, #56AB2F 0%, #A8E063 100%); }
.general-theme-2 { background: linear-gradient(135deg, #00C9FF 0%, #92FE9D 100%); }
.general-theme-3 { background: linear-gradient(135deg, #0f0c29 0%, #302b63 100%); }
.general-theme-4 { background: linear-gradient(135deg, #bc4e9c 0%, #f80759 100%); }
.general-theme-5 { background: linear-gradient(135deg, #004643 0%, #001e1d 100%); }

.g-overlay { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.85) 100%); z-index: 1; }
.g-watermark { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 80%; opacity: 0.05; z-index: 1; pointer-events: none; filter: grayscale(1); }
.g-border-frame { position: absolute; inset: 15px; border: 1px solid rgba(255, 215, 0, 0.3); border-radius: 12px; z-index: 2; pointer-events: none; }
.g-border-frame::before { content: ''; position: absolute; inset: 6px; border: 1px dashed rgba(255, 215, 0, 0.2); border-radius: 8px; }

.g-header, .g-body, .g-footer { position: relative; z-index: 3; }

.g-header { margin-bottom: auto; display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.g-logo { font-family: 'Yatra One', cursive; font-size: 1.4rem; color: #FFF; text-shadow: 0 2px 4px rgba(0,0,0,0.5); opacity: 0.9; }
.g-divider { display: flex; align-items: center; justify-content: center; gap: 0.5rem; width: 100%; max-width: 200px; opacity: 0.5; color: #FFD700; }
.g-divider .line { height: 1px; background: linear-gradient(90deg, transparent, #FFD700, transparent); flex: 1; }
.g-divider .star-icon { font-size: 1rem; }

.g-body { margin-top: auto; margin-bottom: auto; padding-top: 1.5rem; }
.g-photo-frame {
    position: relative; width: 140px; height: 140px; margin: 0 auto 1.5rem auto; border-radius: 50%;
    border: 3px solid #FFD700; padding: 4px; box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    background: rgba(255,255,255,0.1);
}
.g-photo-frame img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.g-title { font-family: 'Yatra One', cursive; font-size: 1.8rem; color: #FFD700; margin-bottom: 0.5rem; line-height: 1.2; text-shadow: 2px 2px 10px rgba(0,0,0,0.8); }
.g-num { font-family: 'Playfair Display', serif; font-weight: 700; color: #fff; margin-right: 1px; }
.g-suffix { font-family: 'Playfair Display', serif; font-size: 0.55em; vertical-align: super; opacity: 0.9; font-weight: 600; color: #FFD700; }
.g-name { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.2rem; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
.g-father { font-size: 0.95rem; opacity: 0.85; margin-bottom: 1.5rem; font-style: italic; color: #cbd5e1; font-weight: 300; }

.g-msg-container { position: relative; padding: 0 2rem; margin: 0 auto; max-width: 90%; }
.quote-left, .quote-right { position: absolute; font-family: Georgia, serif; font-size: 3rem; color: #FFD700; opacity: 0.2; line-height: 0; }
.quote-left { left: 0; top: 1rem; }
.quote-right { right: 0; bottom: -0.5rem; }
.g-message { font-size: 0.95rem; line-height: 1.6; font-weight: 400; color: #FFF; opacity: 0.95; }
.g-message .highlight { color: #FFD700; font-weight: 700; text-shadow: 0 0 5px rgba(255, 215, 0, 0.5); }

/* Card Senders Container */
.g-senders-container { width: 100%; margin-bottom: 1rem; display: flex; flex-direction: column; align-items: center; gap: 0.5rem; z-index: 3; }
.g-senders-label { font-size: 0.85rem; color: rgba(255,255,255,0.8); font-style: italic; font-weight: 300; }
.g-senders-wrap { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; }
.g-sender-box { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; }
.g-sender-box img { width: 40px; height: 40px; border-radius: 50%; border: 2px solid rgba(255, 215, 0, 0.8); object-fit: cover; }
.g-sender-box span { font-size: 0.75rem; font-weight: 600; color: white; text-shadow: 1px 1px 2px rgba(0,0,0,0.8); }

.g-footer { display: flex; justify-content: space-between; align-items: flex-end; margin-top: auto; font-size: 0.85rem; opacity: 0.6; font-weight: 500; font-family: monospace; letter-spacing: 0.5px; }
.g-website { font-size: 0.75rem; color: #FFD700; opacity: 0.8; }


/* Password Overlay */
#password-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--dark);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-family: 'Hind', sans-serif;
    color: var(--light);
}
#password-overlay .lock-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--primary);
}
#password-overlay h2 {
    margin-bottom: 0.5rem;
    font-size: 2rem;
    font-family: 'Yatra One', cursive;
}
#password-overlay p {
    margin-bottom: 2rem;
    opacity: 0.8;
}
#password-input {
    padding: 1rem 1.5rem;
    font-size: 1.5rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    color: var(--light);
    text-align: center;
    letter-spacing: 0.5rem;
    width: 200px;
    outline: none;
    transition: border-color 0.3s;
}
#password-input:focus {
    border-color: var(--primary);
}
#password-error {
    color: var(--accent);
    margin-top: 1rem;
    height: 20px;
    font-size: 0.9rem;
}
[data-theme="light"] #password-overlay {
    background: var(--light);
    color: var(--dark);
}
[data-theme="light"] #password-input {
    background: rgba(0, 0, 0, 0.05);
    color: var(--dark);
    border-color: rgba(0, 0, 0, 0.2);
}
[data-theme="light"] #password-input:focus {
    border-color: var(--primary);
}
