/* 
 ========================================================
 Telegram Mini App - Premium Dark Purple Theme CSS
 ফাইল: css/style.css
 মোবাইল-ফার্স্ট ডিজাইন, পার্পল নিয়ন গ্লো, গ্লাসফর্মিজম এবং রেসপন্সিভ স্টাইলিং
 ========================================================
*/

/* ১. রুট ভ্যারিয়েবল ও থিম কালার */
:root {
    --bg-color: #0d0b14;
    --card-bg: #1a162b;
    --card-border: #2e274c;
    --primary-purple: #8b5cf6;
    --primary-purple-dark: #6d28d9;
    --purple-glow: rgba(139, 92, 246, 0.4);
    --text-color: #ffffff;
    --text-muted: #a1a1aa;
    --heart-red: #ef4444;
    --bottom-nav-bg: #141022;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --telegram-safe-bottom: env(safe-area-inset-bottom, 10px);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family);
    min-height: 100vh;
    overflow-x: hidden;
    padding-bottom: calc(75px + var(--telegram-safe-bottom));
}

/* ২. প্রিমিয়াম লোডার স্ক্রিন (Pulsating Orb Loader) */
#app-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #07060a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#app-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-orb-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-orb {
    width: 36px;
    height: 36px;
    background-color: var(--primary-purple);
    border-radius: 50%;
    box-shadow: 0 0 25px var(--primary-purple);
}

.loader-ring {
    position: absolute;
    width: 70px;
    height: 70px;
    border: 3px solid transparent;
    border-top-color: var(--primary-purple);
    border-right-color: rgba(139, 92, 246, 0.3);
    border-radius: 50%;
    animation: spin 1.2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-text {
    margin-top: 25px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #e4e4e7;
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.6);
    text-transform: uppercase;
}

/* ৩. অ্যাপ হেডার (Header Layout) */
.app-header {
    position: sticky;
    top: 0;
    background-color: rgba(13, 11, 20, 0.92);
    backdrop-filter: blur(12px);
    z-index: 100;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon-box {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-purple), var(--primary-purple-dark));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    box-shadow: 0 0 12px var(--purple-glow);
}

.brand-title {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #ffffff;
    text-transform: uppercase;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.icon-btn {
    background: transparent;
    border: none;
    color: #d4d4d8;
    font-size: 18px;
    cursor: pointer;
    position: relative;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notif-badge {
    position: absolute;
    top: -2px;
    right: -4px;
    background-color: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 10px;
    border: 2px solid var(--bg-color);
}

.user-avatar-mini {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--primary-purple);
}

/* ৪. সার্চ বার ও ক্যাটাগরি ফিল্টার চিপস */
.search-container {
    padding: 12px 16px 6px;
    display: flex;
    gap: 8px;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
}

.search-input {
    width: 100%;
    height: 42px;
    background-color: #171326;
    border: 1px solid #2b2545;
    border-radius: 12px;
    padding: 0 14px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.search-input:focus {
    border-color: var(--primary-purple);
}

.search-input::placeholder {
    color: #71717a;
}

.search-submit-btn {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary-purple), var(--primary-purple-dark));
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 10px var(--purple-glow);
}

.categories-scroll {
    display: flex;
    gap: 8px;
    padding: 8px 16px 12px;
    overflow-x: auto;
    scrollbar-width: none;
}

.categories-scroll::-webkit-scrollbar {
    display: none;
}

.category-chip {
    padding: 8px 16px;
    background-color: #1a162b;
    border: 1px solid #2e274c;
    border-radius: 20px;
    font-size: 13px;
    color: #a1a1aa;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}

.category-chip.active {
    background: linear-gradient(135deg, var(--primary-purple), var(--primary-purple-dark));
    color: #fff;
    border-color: var(--primary-purple);
    font-weight: 600;
    box-shadow: 0 0 10px var(--purple-glow);
}

/* ৫. পোস্ট কন্টেন্ট কার্ড (Content Card Styling) */
.posts-grid {
    padding: 8px 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.section-title-bar {
    padding: 10px 16px 2px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.section-title-bar span {
    color: var(--primary-purple);
}

.post-card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.card-thumb-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    overflow: hidden;
    background-color: #120e1f;
}

.card-thumb-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fav-float-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 38px;
    height: 38px;
    background-color: rgba(13, 11, 20, 0.65);
    backdrop-filter: blur(8px);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: transform 0.2s, color 0.2s;
}

.fav-float-btn.active {
    color: var(--heart-red);
}

.fav-float-btn:active {
    transform: scale(0.9);
}

.card-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card-header-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.card-channel-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #4c1d95);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: 15px;
    flex-shrink: 0;
}

.card-title-col {
    flex: 1;
}

.card-post-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    color: #ffffff;
    margin-bottom: 4px;
}

.card-post-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-post-meta .heart-icon {
    color: var(--heart-red);
}

.card-options-btn {
    background: transparent;
    border: none;
    color: #a1a1aa;
    font-size: 18px;
    cursor: pointer;
    padding: 2px;
}

.card-emoji-row {
    font-size: 14px;
}

.card-actions-row {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.unlock-action-btn {
    flex: 1;
    height: 44px;
    background: linear-gradient(135deg, var(--primary-purple), var(--primary-purple-dark));
    border: none;
    border-radius: 12px;
    color: #ffffff;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 0 15px var(--purple-glow);
    transition: transform 0.15s;
}

.unlock-action-btn.unlocked-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.unlock-action-btn:active {
    transform: scale(0.98);
}

.share-action-btn {
    width: 44px;
    height: 44px;
    background-color: #231d3b;
    border: 1px solid #3d3361;
    border-radius: 12px;
    color: #fff;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.share-action-btn:active {
    background-color: var(--primary-purple);
}

/* ৬. দরকারি লিঙ্ক পেজ (Useful Links Cards) */
.links-container {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.useful-link-card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.link-info-left {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

.telegram-circle-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2aabee, #229ed9);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.link-text-group {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.link-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

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

.link-open-btn {
    padding: 8px 18px;
    background: linear-gradient(135deg, var(--primary-purple), var(--primary-purple-dark));
    border: none;
    border-radius: 20px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 0 10px var(--purple-glow);
    flex-shrink: 0;
}

/* ৭. প্রোফাইল পেজ (Profile Layout) */
.profile-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.profile-banner-header {
    width: 100%;
    height: 110px;
    background: linear-gradient(135deg, #6d28d9, #3b0764);
    position: relative;
}

.profile-avatar-wrapper {
    position: relative;
    margin-top: -45px;
    margin-bottom: 12px;
}

.profile-avatar-img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-purple);
    box-shadow: 0 0 20px var(--purple-glow);
    background-color: #1f1a35;
}

.profile-name {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
}

.profile-username {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.stats-card-box {
    width: calc(100% - 32px);
    background-color: #171326;
    border: 1px solid #2b2545;
    border-radius: 16px;
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    text-align: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-item:not(:last-child) {
    border-right: 1px solid #2e274c;
}

.stat-value {
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
}

.stat-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.join-date-badge {
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ৮. ফিক্সড বটম নেভিগেশন বার (Bottom Navigation Pill) */
.bottom-nav-container {
    position: fixed;
    bottom: var(--telegram-safe-bottom);
    left: 0;
    width: 100%;
    padding: 0 16px 8px;
    z-index: 1000;
}

.bottom-nav-pill {
    background-color: rgba(20, 16, 34, 0.95);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 6px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.nav-item-btn {
    flex: 1;
    height: 44px;
    border-radius: 22px;
    background: transparent;
    border: none;
    color: #9ca3af;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.nav-item-btn .nav-icon {
    font-size: 16px;
}

.nav-item-btn.active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.35), rgba(109, 40, 217, 0.5));
    color: #ffffff;
    box-shadow: inset 0 0 10px var(--purple-glow);
}

/* ৯. নোটিফিকেশন মডাল ও পপআপ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content-sheet {
    width: 100%;
    max-height: 80vh;
    background-color: #141022;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    border-top: 1px solid var(--card-border);
    padding: 20px;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-content-sheet {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: #a1a1aa;
    font-size: 20px;
    cursor: pointer;
}

.notif-item-card {
    background-color: #1c172e;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    border-left: 3px solid var(--primary-purple);
}

.notif-item-card.read {
    border-left-color: #4b5563;
    opacity: 0.7;
}

/* ১০. টোস্ট নোটিফিকেশন সিস্টেম */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast-msg {
    background-color: rgba(26, 22, 43, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid var(--primary-purple);
    color: #fff;
    padding: 10px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); }
}

/* ১১. এম্পটি স্টেট (Empty States) */
.empty-state-box {
    padding: 40px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.empty-icon {
    font-size: 42px;
    color: var(--primary-purple);
    opacity: 0.8;
}

.empty-text {
    font-size: 14px;
    color: var(--text-muted);
}

/* ১২. শেয়ারড পোস্ট পেজ হেডার ব্যাক বাটন */
.shared-home-bar {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #171326;
    border-bottom: 1px solid #2b2545;
}

.home-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--primary-purple), var(--primary-purple-dark));
    color: #fff;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 0 10px var(--purple-glow);
}
