:root {
    --primary-color: #0f172a;
    --accent-color: #2563eb;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --bg-color: #fff;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --input-bg: #f1f5f9;
    --card-hover-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    --transition-speed: 0.3s;
    --loader-color: #ff0000;
    --fs-xs: clamp(0.7rem, 0.65rem + 0.25vw, 0.8rem);
    --fs-sm: clamp(0.8rem, 0.75rem + 0.25vw, 0.9rem);
    --fs-base: clamp(0.95rem, 0.9rem + 0.25vw, 1.05rem);
    --fs-md: clamp(1.1rem, 1rem + 0.5vw, 1.3rem);
    --fs-lg: clamp(1.4rem, 1.25rem + 0.75vw, 1.8rem);
    --fs-xl: clamp(1.8rem, 1.5rem + 1.5vw, 2.8rem);
}








body.dark-mode {
    --primary-color: #f8fafc;
    --accent-color: #3b82f6;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --card-bg-rgb: 30, 41, 59;
    --border-color: #334155;
    --input-bg: #334155;
    --card-hover-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
    font-size: var(--fs-base);
    letter-spacing: 0.015em;
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4 {
    color: #fff;
    letter-spacing: -0.01em;
}

body.dark-mode .btn-primary,
body.dark-mode .connect-btn,
body.dark-mode .btn-post {
    background-color: black !important;
    font-size: 15px;
}

body.dark-mode .alert-error {
    background-color: #0f172a !important;
    color: red !important;
}

body.dark-mode .post-card {
    border-top: 3px solid #484a4f;
    margin-bottom: 0px;
}

body.dark-mode a {
    color: var(--accent-color);
}


body {
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

a {
    word-break: break-word;
}

.btn-post.loading {
    pointer-events: none;
    color: white;
    position: relative;
}

.btn-post .spinner {
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, .3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


.theme-switch-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.theme-switch {
    display: inline-block;
    height: 24px;
    position: relative;
    width: 44px;
}

.theme-switch input {
    display: none;
}

.slider {
    background-color: #ccc;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    background-color: #fff;
    bottom: 4px;
    content: "";
    height: 16px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 16px;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--accent-color);
}

input:checked+.slider:before {
    transform: translateX(20px);
}

#page-loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 200000;

    background-color: transparent;
    pointer-events: none;
    display: none;
}

#page-loader-progress {
    width: 0%;
    height: 100%;
    background-color: var(--loader-color);
    box-shadow: 0 0 10px var(--loader-color);
    transition: width 0.2s ease-out;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: clamp(1.4, 1.45, 1.6);
    min-height: 100vh;
    font-size: var(--fs-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Dashboard / Feed Layout --- */
.dashboard-container {
    display: grid;
    grid-template-columns: 260px 1fr 340px;
    min-height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
    gap: clamp(12px, 2vw, 24px);
}

.content-section {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.content-section.active {
    display: block;
    opacity: 1;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 24px 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.brand {
    font-size: var(--fs-lg);
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
    color: var(--primary-color);
}

.tagline {
    font-size: var(--fs-xs);
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-weight: 500;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 4px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.menu-item i:not(.chevron-icon) {
    width: 20px;
    text-align: center;
}

.chevron-icon {
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.3s ease;
}

.menu-item.active .chevron-icon {
    transform: rotate(180deg);
}

.menu-item.active {
    background: rgba(37, 99, 235, 0.08);
    color: var(--accent-color);
}

.menu-item:hover {
    background: var(--input-bg);
    color: var(--text-primary);
}

.sidebar .create-post {
    order: 10;
}

/* Dropdown Content */
.dropdown-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(0, 0, 0, 0.02);
    border-radius: 12px;
    margin: 0 4px;
}

body.dark-mode .dropdown-container {
    background: rgba(255, 255, 255, 0.02);
}

.dropdown-container.active {
    max-height: 300px;
    margin-bottom: 8px;
    padding: 4px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
}

.dropdown-item i {
    font-size: 12px;
    opacity: 0.7;
}

.dropdown-item:hover {
    background: rgba(37, 99, 235, 0.08);
    color: var(--accent-color);
    transform: translateX(4px);
}

/* Feed */
.feed-container {
    padding: 24px 0;
    max-width: 700px;

    width: 100%;
}

.hero-banner {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: #ffffff;
    padding: 32px;
    border-radius: 20px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.3);
}

.hero-banner::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 1.79 4 4 4zm29 22c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 1.79 4 4 4zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.6;
    pointer-events: none;
}

.hero-banner h2 {
    margin: 0 0 8px;
    font-size: var(--fs-lg);
    font-weight: 700;
}

.hero-banner p {
    margin: 0;
    font-size: var(--fs-base);
    opacity: 0.9;
}

.create-post-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.create-post-card input {
    width: 100%;
    padding: 16px 20px;
    border-radius: 50px;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    transition: all 0.2s;
    font-size: var(--fs-base);
}

.create-post-card input:focus {
    background: #fff;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    outline: none;
}

.post-card {
    background: var(--card-bg);
    padding: 4px;
    margin-bottom: 2%;
    border-radius: 6px;
    border: 1px solid var(--border-color) !important;
    transition: transform 0.2s, box-shadow 0.2s;
}

.post-card:hover {
    box-shadow: var(--card-hover-shadow);
}

.post-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 12px 16px;
    gap: 12px;
}

.header-main-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.post-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    transition: transform 0.2s ease;
}

.avatar-link:hover .post-avatar {
    transform: scale(1.05);
    border-color: var(--accent-color);
}

.user-meta-data {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.user-full-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    line-height: 1.2;
}

.user-full-name:hover {
    text-decoration: underline;
}

.verified-badge {
    color: var(--accent-color);
    font-size: 13px;
}

.role-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.role-badge.professor {
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent-color);
    border: 1px solid rgba(37, 99, 235, 0.2);
}

.role-badge.student {
    background: rgba(100, 116, 139, 0.1);
    color: var(--text-secondary);
    border: 1px solid rgba(100, 116, 139, 0.2);
}

.sub-info-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.user-handle {
    font-weight: 500;
    opacity: 0.9;
}

.meta-dot {
    opacity: 0.5;
    font-size: 10px;
}

.post-time {
    font-weight: 400;
    opacity: 0.8;
}

.user-designation,
.user-academic {
    font-style: italic;
    font-weight: 400;
}

.post-menu-trigger {
    padding: 8px;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-menu-trigger:hover {
    background: var(--input-bg);
    color: var(--text-primary);
}

.post-content {
    /* margin: 12px 0 16px; */
    font-size: var(--fs-base);
    color: var(--text-primary);
    line-height: 1.6;
    position: relative;
}

/* Desktop Truncation */
.post-content .description-text.truncated {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    /* Fallback for 120 chars if JS fails, but we'll use JS for exact 120 */
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.see-more-toggle {
    color: var(--accent-color);
    font-weight: 600;
    cursor: pointer;
    margin-left: 5px;
    font-size: 15px;
}

.see-more-toggle:hover {
    text-decoration: underline;
}

/* Side Drawer Animation for Mobile */
.notification_detail_modal {
    position: fixed;
    top: 0;
    right: -100%;
    /* Start off-screen */
    background: var(--card-bg);
    height: 100vh;
    width: 100%;
    max-width: 500px;
    z-index: 99999;
    /* Above everything */
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
}

.notification_detail_modal.active {
    /*transform: translateX(-100%);*/
    right: 0;
}

/* Mobile specific overrides */
@media (max-width: 768px) {
    .notification_detail_modal {
        max-width: 100%;
        border-radius: 0;
    }

    .post-content {
        cursor: pointer;
        /* Whole content is clickable on mobile */
    }
}

.body-scroll-lock {
    overflow: hidden;
}


/* Media Carousel */
.media-carousel {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    margin-top: 12px;
    background: #000;
    aspect-ratio: 16/13;
    user-select: none;
    touch-action: pan-y;
}

.carousel-track {
    display: flex;
    transition: transform 0.3s cubic-bezier(0.215, 0.61, 0.355, 1);
    height: 100%;
    width: 100%;
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.carousel-slide img,
.carousel-slide video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

.carousel-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
}

.media-carousel:hover .carousel-nav-btn {
    opacity: 1;
}

.carousel-nav-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.carousel-nav-btn.prev {
    left: 8px;
}

.carousel-nav-btn.next {
    right: 8px;
}

.media-counter {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    z-index: 10;
    backdrop-filter: blur(4px);
}

/* Modals */
.media-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 15000 !important;
    /* must beat .app-modal-overlay z-index: 8999 !important */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.media-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.media-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.media-modal-content img,
.media-modal-content video {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.modal-close-btn {
    position: absolute;
    top: -50px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
    padding: 10px;
    transition: transform 0.2s ease;
}

.modal-close-btn:hover {
    transform: scale(1.2);
}

.modal-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 20px;
    z-index: 10000;
}

.modal-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-nav-btn.prev {
    left: -70px;
}

.modal-nav-btn.next {
    right: -70px;
}

/* Mention Container */
/* ═══════════════════════════════════════════════════
   Mention Dropdown  —  floats above ALL modals/sheets
   z-index 30000 > action sheets (25000) > reels (20000)
═══════════════════════════════════════════════════ */
.mention-container {
    position: fixed;
    /* escapes overflow:hidden modals */
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22), 0 4px 12px rgba(0, 0, 0, 0.12);
    width: 300px;
    max-height: 260px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 30000;
    display: none;
    opacity: 0;
    transform: translateY(8px) scale(0.97);
    transition: opacity 0.18s ease, transform 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.mention-container::-webkit-scrollbar {
    width: 4px;
}

.mention-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.mention-container.active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.mention-list {
    list-style: none;
    padding: 6px 0;
    margin: 0;
}

.mention-item {
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s ease;
    color: var(--text-primary);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 3px solid transparent;
    position: relative;
}

.mention-item:hover,
.mention-item.selected {
    background: rgba(37, 99, 235, 0.08);
    border-left-color: var(--accent-color);
}

.mention-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.mention-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    display: block;
}

.mention-item.selected .mention-avatar,
.mention-item:hover .mention-avatar {
    border-color: var(--accent-color);
}

.mention-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.mention-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mention-username {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mention-verified {
    font-size: 12px;
    color: #1d9bf0;
    flex-shrink: 0;
}

.mention-no-results {
    padding: 20px 16px;
    color: var(--text-secondary);
    font-size: 14px;
    text-align: center;
    list-style: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.mention-no-results i {
    font-size: 22px;
    opacity: 0.4;
}

@keyframes highlightPost {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
        background: rgba(37, 99, 235, 0.05);
    }

    50% {
        box-shadow: 0 0 30px 10px rgba(37, 99, 235, 0.2);
        background: rgba(37, 99, 235, 0.1);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
        background: transparent;
    }
}

.highlight-post {
    animation: highlightPost 2s ease-out;
    border: 2px solid var(--accent-color) !important;
}

.attachment-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
    max-height: 200px;
    overflow-y: auto !important;
    padding: 10px;
    background: var(--bg-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.preview-item {
    position: relative;
    aspect-ratio: 1/1;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.preview-item img,
.preview-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-preview {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    z-index: 5;
}

/* Right Panel */
.right-panel {
    position: sticky;
    top: 24px;
    height: calc(100vh - 48px);
    padding: 24px 20px;
    border-radius: 24px;
    background: rgba(var(--card-bg-rgb, 255, 255, 255), 0.7);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow-y: auto;
    margin: 24px 16px 24px 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.right-panel::-webkit-scrollbar {
    width: 4px;
}

.right-panel::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

.right-panel h3 {
    margin-top: 0;
    font-size: var(--fs-md);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.search-box {
    position: relative;
    margin-bottom: 28px;
}

.search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 14px;
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    outline: none;
    background: var(--input-bg);
    font-size: var(--fs-sm);
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.search-loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    color: var(--text-secondary);
    font-size: 14px;
    display: none;
}

.search-loading-spinner i {
    font-size: 24px;
    margin-bottom: 10px;
    color: var(--accent-color);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@media (max-width: 1200px) {
    .dashboard-container {
        grid-template-columns: 240px 1fr 300px;
        gap: 16px;
    }
}

@media (max-width: 1024px) {
    .dashboard-container {
        display: flex;
    }

    .sidebar {
        padding: 24px 8px;
    }

    /*.brand,*/
    /*.tagline,*/
    /*.menu-item span,*/
    /*.chevron-icon {*/
    /*    display: none;*/
    /*}*/

    .menu-item {
        padding: 12px;
    }

    .right-panel {
        display: none;
    }
}

@media (max-width: 768px) {
    .dashboard-container {
        grid-template-columns: 1fr !important;
        padding-bottom: 80px;
    }

    .sidebar .search {
        display: block !important;
        padding-top: 26px;
    }

    .feed-container {
        padding: 0;
        overflow-x: auto;
    }

    .right-panel {
        border-radius: 0px;
        border: none;
        margin: 0;
    }

    .sidebar {
        position: fixed;
        bottom: 0;
        top: auto;
        left: 0;
        width: 100%;
        height: 70px;
        flex-direction: row;
        justify-content: space-around;
        background: var(--card-bg);
        border-top: 1px solid var(--border-color);
        padding: 0;
        z-index: 100;
        box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.05);
    }

    .post-card {

        border-top: 4px solid #d0d0d0;
        border: none;
    }

    .create-post-card {
        display: none !important;
    }

    .brand,
    .tagline,
    .theme-toggle,
    .setting,
    .user-notification,
    .user-profile,
    .privacy-policy,
    .terms-and-conditions,
    .dropdown-container,
    .logout,
    .profile,
    .message {
        display: none !important;
    }

    .menu-item {
        flex-direction: column;
        gap: 4px;
        font-size: 10px;
        padding: 10px;
        margin: 0;
        border-radius: 0;
        background: transparent !important;
        color: var(--text-secondary) !important;
        box-shadow: none !important;
    }

    .menu-item i {
        font-size: 18px;
    }

    .menu-item.active {
        color: var(--accent-color) !important;
    }

    .sidebar .create-post {
        order: 0;
    }
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    z-index: 5000 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.33, 1, 0.68, 1), visibility 0.4s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.post-modal-card {
    background: var(--card-bg);
    width: 100%;
    max-width: 550px;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translateY(30px) scale(0.98);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.33, 1, 0.68, 1), opacity 0.3s ease;
    overflow: hidden;
    margin: 16px;
    border: 1px solid var(--border-color);
}

.modal-overlay.active .post-modal-card {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.modal-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-card-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.close-modal {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bg-color);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-modal:hover {
    background: #fee2e2;
    color: #ef4444;
}

.modal-card-body {
    padding: 20px;
}

.user-preview {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.user-preview .avatar {
    width: 44px;
    height: 44px;
}

.user-meta h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}

.audience-tag {
    background: var(--bg-color);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
    cursor: pointer;
}

.post-textarea {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 18px;
    color: var(--text-primary);
    resize: none;
    font-family: inherit;
    outline: none;
    padding: 0;
    margin-bottom: 20px;
}

.remove-attachment {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-card-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.add-to-post {
    background: var(--bg-color);
    padding: 8px 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border-color);
}

.add-to-post span {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.attachment-btn {
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
}

.attachment-btn:hover {
    color: var(--accent-color);
    transform: scale(1.1);
}

.btn-post {
    background: var(--primary-color);
    color: white;
    padding: 10px 24px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}

.btn-post:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(15, 23, 42, 0.3);
}

.btn-post:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.post-footer {
    display: flex;
    justify-content: space-around;
    margin-top: 10px;
}

.useful i {
    color: gray;
}

.useful {
    cursor: pointer;
    width: 25%;
    text-align: center;
}

.useful.like i {
    color: #ef4444;
    font-weight: 900;
}

.useful.like span {
    color: #ef4444;
    font-weight: 600;
}

@keyframes heartPop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.4);
    }

    100% {
        transform: scale(1);
    }
}

.heart-pop {
    animation: heartPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@media (max-width: 550px) {
    .post-modal-card {
        margin: 0;
        position: fixed;
        bottom: 0;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
    }

    .modal-overlay.active .post-modal-card {
        transform: translateY(0);
    }
}

/* Comment Modal */
.comment-modal-card {
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.comment-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--bg-color);
}

.comment-item {
    display: flex;
    gap: 14px;
    margin-bottom: 24px;
    position: relative;
}

.comment-content-wrapper {
    flex: 1;
}

.comment-bubble {
    background: var(--input-bg);
    padding: 12px 16px;
    border-radius: 18px;
    border-top-left-radius: 4px;
    position: relative;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

body.dark-mode .comment-bubble {
    background: rgba(255, 255, 255, 0.04);
}

.comment-bubble:hover {
    background: var(--card-bg);
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.comment-user {
    font-weight: 800;
    font-size: 13.5px;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.comment-bubble p {
    font-size: 14.5px;
    line-height: 1.5;
    margin: 0;
    color: var(--text-primary);
}

.comment-actions {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    padding-left: 4px;
    display: flex;
    align-items: center;
    gap: 16px;
    font-weight: 500;
}

.reply-btn {
    font-weight: 700;
    cursor: pointer;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 11px;
}

.reply-btn:hover {
    text-decoration: underline;
}

/* Enhanced Threading */
.comment-item.is-reply {
    margin-left: 50px;
    margin-top: -8px;
    padding-left: 20px;
    position: relative;
    margin-bottom: 16px;
}

.comment-item.is-reply::before {
    content: '';
    position: absolute;
    left: 0;
    top: -24px;
    height: calc(100% + 12px);
    width: 2px;
    background: var(--border-color);
    opacity: 0.6;
}

.comment-item.is-reply::after {
    content: '';
    position: absolute;
    left: 0;
    top: 20px;
    width: 14px;
    height: 2px;
    background: var(--border-color);
    opacity: 0.6;
}

.comment-actions-menu {
    position: absolute;
    right: 8px;
    top: 8px;
    display: flex;
    gap: 10px;
    opacity: 0.6;
    transition: all 0.2s ease;
}

.comment-item:hover .comment-actions-menu {
    opacity: 1;
}

.action-icon {
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.action-icon:hover {
    background: var(--bg-color);
    color: var(--accent-color);
}

.action-icon.delete:hover {
    color: #ef4444;
}

.toggle-replies-btn {
    margin-left: 64px;
    margin-bottom: 16px;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(37, 99, 235, 0.05);
    border-radius: 20px;
    width: fit-content;
    transition: all 0.2s;
}

.toggle-replies-btn:hover {
    background: rgba(37, 99, 235, 0.1);
}

.toggle-replies-btn i {
    font-size: 10px;
    transition: transform 0.3s;
}

.toggle-replies-btn.active i {
    transform: rotate(180deg);
}

.replies-container {
    display: none;
    margin-bottom: 12px;
}

.replies-container.active {
    display: block;
}

.comment-item:last-child {
    margin-bottom: 0;
}

.comment-context-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-color);
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.comment-context-bar.active {
    display: flex;
}

.cancel-context {
    cursor: pointer;
    color: #ef4444;
    font-weight: 600;
}

@media (max-width: 767px) {
    .comment-modal-footer {
        display: block
    }
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 8px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    border: 2px solid var(--card-bg);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.verified-badge {
    color: blue;
    font-weight: bold;
}

@media (max-width: 768px) {
    .notification-badge {
        top: 5px;
        right: 50%;
        margin-right: -25px;
    }
}

/* User Card in Search */
.user-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--bg-color);
    border-radius: 16px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.user-card:hover {
    border-color: var(--accent-color);
    background: rgba(37, 99, 235, 0.04);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.connect-btn {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: var(--primary-color);
    color: white;
    transition: all 0.2s;
}

.connect-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.connect-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.empty-search {
    text-align: center;
    padding: 24px;
    color: var(--text-secondary);
    font-size: 14px;
    background: var(--bg-color);
    border-radius: 12px;
    border: 1px dashed var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

/* ===== Identity Page (hi.html) ===== */
.page-header {
    text-align: center;
    margin-bottom: 40px;
    padding-top: 40px;
}

.page-header h1 {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 10px 0;
}

.page-header .subtitle {
    font-size: 16px;
    color: var(--text-secondary);
}

.identity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto 60px;
    padding: 20px;
}

.identity-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 32px 24px;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.identity-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-color);
    box-shadow: 0 20px 40px -12px rgba(37, 99, 235, 0.2);
}

.icon-wrapper {
    width: 80px;
    height: 80px;
    background: rgba(37, 99, 235, 0.08);
    /* Fallback */
    background: var(--input-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--accent-color);
    transition: all 0.3s ease;
}

.identity-card:hover .icon-wrapper {
    background: var(--accent-color);
    color: white;
    transform: scale(1.1) rotate(-5deg);
}

.identity-card h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.card-arrow {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    margin-top: auto;
}

.identity-card:hover .card-arrow {
    background: var(--text-primary);
    color: var(--bg-color);
    border-color: var(--text-primary);
}

/* ===== Authentication Layout (Login/Signup) ===== */
.login-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    background: var(--bg-color);
}

.login-carousel-section {
    position: relative;
    background: #000;
    overflow: hidden;
}

.login-carousel-section .carousel,
.login-carousel-section .carousel-inner,
.login-carousel-section .carousel-item {
    height: 100vh;
}

.login-carousel-section img {
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
}

.carousel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.8));
    pointer-events: none;
    z-index: 1;
}

.carousel-caption {
    z-index: 2;
    bottom: 80px;
    text-align: left;
    left: 60px;
    right: 60px;
}

.carousel-caption h5 {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 16px;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.carousel-caption p {
    font-size: 18px;
    opacity: 0.9;
    max-width: 500px;
}

.login-form-section {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.login-form-container {
    width: 100%;
    max-width: 440px;
}

.brand-small {
    font-size: 24px;
    font-weight: 900;
    color: var(--accent-color);
    margin-bottom: 24px;
    letter-spacing: -1px;
}

.login-form-container h2 {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Form Group Styling */
.form-group {
    position: relative;
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    letter-spacing: 0.01em;
    transition: color 0.3s ease;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 14px 18px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background: var(--input-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.form-group input[type="text"]:hover,
.form-group input[type="email"]:hover,
.form-group input[type="password"]:hover {
    border-color: var(--accent-color);
    background: var(--bg-color);
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="password"]:focus {
    border-color: var(--accent-color);
    background: var(--bg-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1),
        0 2px 8px rgba(37, 99, 235, 0.15);
    transform: translateY(-1px);
}

.form-group input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
    font-size: 14px;
}

/* Password Input Wrapper Enhancement */
.password-input-wrapper input {
    padding-right: 50px;
}

/* Radio Button Styling */
.form-group input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    outline: none;
    cursor: pointer;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-color);
    margin: 0;
}

.form-group input[type="radio"]:hover {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.form-group input[type="radio"]:checked {
    border-color: var(--accent-color);
    background: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.form-group input[type="radio"]:checked::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
    animation: radioCheck 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes radioCheck {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.2);
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Gender Radio Group Styling */
.form-group label[style*="cursor: pointer"] {
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 0;
}

.form-group label[style*="cursor: pointer"]:hover {
    color: var(--text-primary);
    background: rgba(37, 99, 235, 0.05);
}

.form-group input[type="radio"]:checked+span,
.form-group label:has(input[type="radio"]:checked) {
    color: var(--accent-color);
    font-weight: 600;
}

.password-input-wrapper {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    font-size: 16px;
}

.toggle-password:hover {
    color: var(--text-primary);
}

.form-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

.forgot-password {
    font-size: 14px;
    color: var(--accent-color);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}

.forgot-password:hover {
    color: #1d4ed8;
    text-decoration: underline;
    transform: translateX(2px);
}

.btn-block {
    width: 100%;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    margin-top: 10px;
    background: linear-gradient(135deg, var(--accent-color), #1d4ed8);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-block:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.btn-block:hover::before {
    left: 100%;
}

.btn-block:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.signup-prompt {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-secondary);
}

.signup-prompt a {
    color: var(--accent-color);
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
}

.signup-prompt a:hover {
    text-decoration: underline;
    color: #1d4ed8;
}

/* Alert Styling for Auth Forms */
.alert {
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert i {
    font-size: 18px;
    flex-shrink: 0;
}

.alert-success {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border-color: #10b981;
    color: #065f46;
}

.alert-success i {
    color: #10b981;
}

.alert-error {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border-color: #ef4444;
    color: #991b1b;
}

.alert-error i {
    color: #ef4444;
}

.alert-message {
    flex: 1;
}

.alert-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 4px;
    margin-left: auto;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.alert-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
    transform: rotate(90deg);
}

.alert-close i {
    font-size: 14px;
}

/* Password Reset Specific Styles */
.success-icon-wrapper {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scaleIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.success-icon-wrapper i {
    font-size: 40px;
    color: #10b981;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.info-box {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-left: 4px solid #2563eb;
    padding: 18px 20px;
    border-radius: 12px;
    margin: 24px 0;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.info-box i {
    font-size: 24px;
    color: #2563eb;
    flex-shrink: 0;
    margin-top: 2px;
}

.info-box strong {
    display: block;
    margin-bottom: 8px;
    color: #1e293b;
    font-size: 15px;
}

.info-box ul {
    margin: 8px 0 0;
    padding-left: 20px;
    color: #475569;
}

.info-box ul li {
    margin: 4px 0;
    font-size: 14px;
}

.success-box {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border-left-color: #10b981;
}

.success-box i {
    color: #10b981;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
}

.btn-link {
    text-align: center;
    color: var(--accent-color);
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-link:hover {
    text-decoration: underline;
    color: #1d4ed8;
}

.error-state {
    text-align: center;
    padding: 40px 20px;
}

.error-state i {
    font-size: 64px;
    color: #ef4444;
    margin-bottom: 24px;
    display: block;
}

.error-state h2 {
    margin-bottom: 12px;
}

.error-state .subtitle {
    margin-bottom: 32px;
}

.form-help {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    font-style: italic;
}

.error-message {
    margin-top: 8px;
    color: #ef4444;
    font-size: 13px;
}

.error-message small {
    display: block;
    margin: 4px 0;
}

/* Mobile Responsive for Auth */
@media (max-width: 992px) {
    .login-layout {
        grid-template-columns: 1fr;
    }

    .login-carousel-section {
        height: 250px;
    }

    .login-carousel-section .carousel,
    .login-carousel-section .carousel-inner,
    .login-carousel-section .carousel-item {
        height: 100%;
    }

    .login-form-section {
        padding: 20px;
        align-items: flex-start;
    }

    .d-none {
        display: block !important;
    }

    .carousel-caption {
        bottom: 0px;
    }

    .carousel-caption h5 {
        font-size: 24px;
    }

    .carousel-caption p {
        font-size: 14px;
    }


}

/* --- Modern App-Like Modal System --- */
.app-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    /* Darker overlay */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 8999;
    /* Base modal level */
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.app-modal-overlay.active {
    opacity: 1 !important;
    display: flex !important;
}

.app-modal-card {
    background: var(--card-bg);
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 4001;
}

.app-modal-overlay.active .app-modal-card {
    transform: translateX(0);
}

/* Modal Header */
.app-modal-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--card-bg);
    position: sticky;
    top: 0;
    z-index: 10;
}

.app-modal-back {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    transition: background 0.2s;
    margin-right: 12px;
}

.app-modal-back:hover {
    background: var(--input-bg);
}

.app-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
}

/* Modal Body */
.app-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    max-height: 400px;
    -webkit-overflow-scrolling: touch;
}

#commentModalOverlay .app-modal-body {
    max-height: 100dvh;
}

#openConnectionTypeModal .app-modal-body {
    max-height: 100dvh;
}

/* Desktop View (>768px) */
@media (min-width: 769px) {
    .app-modal-card {
        width: 100%;
        max-width: 600px;
        height: auto;
        max-height: 90vh;
        border-radius: 24px;
        transform: translateX(50px);
        opacity: 0;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    }

    .app-modal-overlay.active .app-modal-card {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Fix for mobile keyboard pushing layout */
@media (max-width: 767px) {


    .app-modal-card {
        height: 100dvh !important;
        /* Dynamic viewport height */
    }
}

/* Custom Alert */
.custom-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 20000;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.custom-alert-overlay.active {
    display: flex;
    opacity: 1;
}

.custom-alert-box {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid var(--border-color);
}

.custom-alert-overlay.active .custom-alert-box {
    transform: scale(1);
}

#customAlertIcon {
    font-size: 48px;
    margin-bottom: 16px;
}

#customAlertTitle {
    margin: 0 0 8px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

#customAlertMessage {
    margin: 0 0 20px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.custom-alert-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    width: 100%;
    font-size: 1rem;
}

.custom-alert-btn:hover {
    opacity: 0.9;
}

/* Prompt Modal Styles */
.prompt-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 21000;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.prompt-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.prompt-modal-container {
    background: var(--card-bg);
    width: 90%;
    max-width: 420px;
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
}

.prompt-modal-overlay.active .prompt-modal-container {
    transform: scale(1) translateY(0);
}

.prompt-modal-icon {
    font-size: 54px;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.prompt-modal-title {
    font-size: var(--fs-md);
    font-weight: 700;
    margin: 0 0 12px;
    color: var(--text-primary);
}

.prompt-modal-message {
    font-size: var(--fs-base);
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 30px;
}

.prompt-modal-footer {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.prompt-btn {
    padding: 12px 24px;
    border-radius: 14px;
    font-weight: 600;
    font-size: var(--fs-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.prompt-btn-primary {
    background: var(--accent-color);
    color: white;
}

.prompt-btn-secondary {
    background: var(--input-bg);
    color: var(--text-primary);
}

.prompt-btn:hover {
    filter: brightness(0.95);
    transform: translateY(-2px);
}

.prompt-btn:active {
    transform: translateY(0);
}

/* Mobile specific for prompt modal */
@media (max-width: 480px) {
    .prompt-modal-container {
        padding: 24px;
        width: calc(100% - 32px);
        margin: 16px;
    }


}

/* Emoji Picker Styles */
.emoji-picker {
    position: fixed;
    width: 320px;
    height: 350px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    z-index: 2147483647 !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    transform: translateY(10px);
}

.emoji-picker.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.emoji-picker-header {
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
}

.emoji-search {
    width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 14px;
}

.emoji-search:focus {
    outline: none;
    border-color: var(--accent-color);
    background: var(--bg-color);
}

.emoji-categories {
    display: flex;
    overflow-x: auto;
    padding: 8px;
    gap: 4px;
    background: var(--input-bg);
    scrollbar-width: none;
}

.emoji-categories::-webkit-scrollbar {
    display: none;
}

.emoji-category-btn {
    background: none;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.emoji-category-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

.emoji-category-btn.active {
    background: var(--card-bg);
    color: var(--accent-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.emoji-grid {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    align-content: start;
}

.emoji-btn {
    background: none;
    border: none;
    font-size: 20px;
    padding: 4px;
    cursor: pointer;
    border-radius: 4px;
    transition: transform 0.1s, background 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emoji-btn:hover {
    transform: scale(1.2);
    background: var(--input-bg);
}

/* Mobile responsive adjustments */
@media (max-width: 480px) {
    .emoji-picker {
        width: 100%;
        max-width: 320px;
        height: 300px;
    }
}

/* Emoji Picker Backdrop */
.emoji-picker-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2147483646 !important;
    /* One less than picker */
    background: transparent;
    display: none;
}

.emoji-picker-backdrop.active {
    display: block;
}

/* Global Alerts Container */
.global-alerts-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    width: 100%;
    max-width: 500px;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.alert {
    pointer-events: auto;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    animation: alertSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

@keyframes alertSlideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.alert i {
    font-size: 20px;
}

.alert-success {
    border-left: 4px solid #10b981;
}

.alert-success i {
    color: #10b981;
}

.alert-error {
    border-left: 4px solid #ef4444;
}

.alert-error i {
    color: #ef4444;
}

.alert-warning {
    border-left: 4px solid #f59e0b;
}

.alert-warning i {
    color: #f59e0b;
}

.alert-message {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.alert-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alert-close:hover {
    background: var(--input-bg);
    color: var(--text-primary);
}

@media (max-width: 480px) {
    .global-alerts-container {
        top: 12px;
        padding: 0 12px;
    }

    .alert {
        padding: 12px 16px;
        border-radius: 12px;
    }
}


/* Media Loading Spinner */
.media-loading-container {
    position: relative;
    display: inline-block;
    height: 100%;
    width: 100%;
}

.media-loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 4px solid rgba(37, 99, 235, 0.2);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    animation: media-spin 0.8s linear infinite;
    z-index: 10;
    pointer-events: none;
}

.media-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    z-index: 9;
    pointer-events: none;
}

body.dark-mode .media-loading-overlay {
    background: rgba(255, 255, 255, 0.05);
}

@keyframes media-spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.media-loading-container img,
.media-loading-container video {
    opacity: 0;
    transition: opacity 0.3s ease-in;
}

.media-loading-container img.loaded,
.media-loading-container video.loaded {
    opacity: 1;
}

.media-loading-container .media-loading-spinner.hidden {
    display: none;
}

/* Global Action Sheet (Bottom Sheet for Mobile/Context Menus)
   z-index must be above Reels overlay (20000) and reel comment sheet (20100) */
.action-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 20000;
    opacity: 0;
    visibility: hidden;
    display: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.action-sheet-overlay.active {
    display: block;
    opacity: 1;
    visibility: visible;
}

/* Slide drawer up when overlay is active */
.action-sheet-overlay.active .action-sheet {
    bottom: 0;
}

.action-sheet {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    width: 100%;
    background: var(--card-bg);
    border-radius: 20px 20px 0 0;
    z-index: 25001;
    transition: bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 500px;
    margin: 0 auto;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25);
}

.action-sheet.active {
    bottom: 0;
}

.action-sheet-header {
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.action-sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
}

.action-sheet-body {
    padding: 10px 0;
}

.action-sheet-item {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 16px 24px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    gap: 15px;
    transition: background 0.2s;
    text-align: left;
}

.action-sheet-item:hover {
    background: var(--input-bg);
}

.action-sheet-item i {
    font-size: 18px;
    width: 24px;
    text-align: center;
    color: var(--text-secondary);
}

.action-sheet-item.delete {
    color: #ef4444;
}

.action-sheet-item.delete i {
    color: #ef4444;
}

.action-sheet-footer {
    padding: 10px 20px 30px;
}

.action-sheet-cancel {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    background: var(--input-bg);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
}