/* ============================================================
   CHATIHUB - Social Media Platform Styles
   Facebook-inspired modern design with Bootstrap 5
   ============================================================ */

/* ---- ROOT VARIABLES ---- */
:root {
    --cp-primary: #e05a2b;
    --cp-primary-dark: #c44a20;
    --cp-primary-light: rgba(224, 90, 43, 0.12);
    --cp-accent: #e05a2b;
    --cp-bg: #0d0d0d;
    --cp-bg-secondary: #141414;
    --cp-card: #1a1a1a;
    --cp-card-hover: #222222;
    --cp-text: #e8e8e8;
    --cp-text-secondary: #8a8a8a;
    --cp-border: #2a2a2a;
    --cp-hover: #252525;
    --cp-success: #2ecc71;
    --cp-danger: #e74c3c;
    --cp-navbar-height: 56px;
    --cp-mobile-nav-height: 56px;
    --cp-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    --cp-shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.5);
    --cp-radius: 8px;
    --cp-radius-lg: 12px;
}

/* ---- DARK THEME BOOTSTRAP OVERRIDES ---- */
.form-control, .form-select {
    background-color: var(--cp-bg-secondary);
    border-color: var(--cp-border);
    color: var(--cp-text);
}

.form-control::placeholder {
    color: var(--cp-text-secondary);
}

.form-check-input {
    background-color: var(--cp-bg-secondary);
    border-color: var(--cp-border);
}

.form-check-input:checked {
    background-color: var(--cp-primary);
    border-color: var(--cp-primary);
}

.dropdown-menu {
    background-color: var(--cp-card);
    border: 1px solid var(--cp-border);
}

.dropdown-item {
    color: var(--cp-text);
}

.dropdown-item:hover, .dropdown-item:focus {
    background-color: var(--cp-hover);
    color: var(--cp-text);
}

.dropdown-divider {
    border-color: var(--cp-border);
}

.modal-content {
    background-color: var(--cp-card);
    border: 1px solid var(--cp-border);
    color: var(--cp-text);
}

.modal-header {
    border-bottom-color: var(--cp-border);
}

.modal-footer {
    border-top-color: var(--cp-border);
}

.btn-outline-secondary {
    color: var(--cp-text-secondary);
    border-color: var(--cp-border);
}

.btn-outline-secondary:hover {
    background-color: var(--cp-hover);
    border-color: var(--cp-border);
    color: var(--cp-text);
}

.btn-outline-primary {
    color: var(--cp-primary);
    border-color: var(--cp-primary);
}

.btn-outline-primary:hover {
    background-color: var(--cp-primary);
    border-color: var(--cp-primary);
    color: #fff;
}

.text-muted {
    color: var(--cp-text-secondary) !important;
}

.badge.bg-white {
    background-color: rgba(255,255,255,0.15) !important;
    color: var(--cp-text) !important;
}

.badge.bg-danger {
    background-color: var(--cp-danger) !important;
}

.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.alert-danger {
    background-color: rgba(231, 76, 60, 0.15);
    border-color: rgba(231, 76, 60, 0.3);
    color: #f87171;
}

.alert-success {
    background-color: rgba(46, 204, 113, 0.15);
    border-color: rgba(46, 204, 113, 0.3);
    color: #4ade80;
}

.badge.bg-success {
    background-color: var(--cp-success) !important;
}

.form-control, .form-select {
    color: var(--cp-text);
}

/* ---- GLOBAL ANIMATIONS ---- */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes popIn {
    0% { opacity: 0; transform: scale(0.5); }
    70% { transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.7; }
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    30% { transform: scale(1.25); }
    50% { transform: scale(0.95); }
    70% { transform: scale(1.1); }
}

@keyframes heartBurst {
    0% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

@keyframes typingDot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* ---- RESET & BASE ---- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--cp-bg);
    color: var(--cp-text);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--cp-primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--cp-primary-dark);
}

/* ---- CUSTOM SCROLLBAR ---- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--cp-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.cp-navbar {
    height: var(--cp-navbar-height);
    background-color: var(--cp-card);
    box-shadow: 0 1px 0 var(--cp-border);
    z-index: 1000;
    padding: 0;
}

.cp-navbar .container-fluid {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo */
.cp-navbar-brand {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--cp-primary) !important;
    text-decoration: none !important;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: -0.5px;
    white-space: nowrap;
}

.cp-navbar-brand:hover {
    color: var(--cp-primary-dark) !important;
}

.cp-navbar-brand i {
    font-size: 1.75rem;
}

/* Search */
.cp-search-form {
    margin-left: 8px;
}

.cp-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.cp-search-icon {
    position: absolute;
    left: 12px;
    color: var(--cp-text-secondary);
    font-size: 0.85rem;
    pointer-events: none;
}

.cp-search-input {
    width: 240px;
    height: 40px;
    border-radius: 50px !important;
    background-color: var(--cp-bg) !important;
    border: none !important;
    padding-left: 36px !important;
    font-size: 0.9rem;
    transition: width 0.3s ease, background-color 0.2s ease;
}

.cp-search-input:focus {
    width: 320px;
    background-color: var(--cp-bg-secondary) !important;
    box-shadow: 0 0 0 2px var(--cp-primary-light) !important;
    outline: none;
}

.cp-search-input::placeholder {
    color: var(--cp-text-secondary);
}

/* Center Nav Tabs */
.cp-nav-center {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 4px;
}

.cp-nav-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    height: var(--cp-navbar-height);
    min-width: 110px;
    padding: 0 16px;
    border-radius: var(--cp-radius) var(--cp-radius) 0 0;
    color: var(--cp-text-secondary) !important;
    font-size: 1.25rem;
    position: relative;
    transition: background-color 0.2s ease;
    text-decoration: none !important;
    border-bottom: none;
}

.cp-nav-tab:hover {
    background-color: var(--cp-hover);
    color: var(--cp-primary) !important;
}

.cp-nav-tab.active {
    color: var(--cp-primary) !important;
    background-color: transparent;
}

.cp-nav-badge {
    position: absolute;
    top: 6px;
    right: 16px;
    background-color: var(--cp-danger);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    line-height: 1;
}

/* Icon Buttons (right side) */
.cp-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--cp-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cp-text) !important;
    font-size: 1.1rem;
    border: none;
    cursor: pointer;
    position: relative;
    text-decoration: none !important;
    transition: background-color 0.2s ease;
}

.cp-icon-btn:hover {
    background-color: var(--cp-hover);
}

.cp-badge-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: var(--cp-danger);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--cp-card);
}

/* Avatar Button */
.cp-avatar-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cp-avatar-btn::after {
    display: none;
}

.cp-avatar-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.cp-avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cp-primary), #c44a20);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.9rem;
    border: 2px solid var(--cp-border);
    transition: border-color 0.2s ease;
}
.cp-avatar-btn:hover .cp-avatar-placeholder {
    border-color: var(--cp-primary);
}

/* Dropdown Menu */
.cp-dropdown-menu {
    border: none;
    box-shadow: var(--cp-shadow-lg);
    border-radius: var(--cp-radius);
    padding: 8px;
    min-width: 220px;
    margin-top: 8px !important;
}

.cp-dropdown-item {
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.15s ease;
}

.cp-dropdown-item:hover {
    background-color: var(--cp-hover);
}

/* Auth Buttons (unauthenticated) */
.cp-btn-login {
    border-radius: 6px;
    font-weight: 600;
    padding: 6px 16px;
}

.cp-btn-register {
    border-radius: 6px;
    font-weight: 600;
    padding: 6px 16px;
    background-color: var(--cp-primary);
    border-color: var(--cp-primary);
}

.cp-btn-register:hover {
    background-color: var(--cp-primary-dark);
    border-color: var(--cp-primary-dark);
}

/* Mobile Search */
.cp-mobile-search {
    position: fixed;
    top: var(--cp-navbar-height);
    left: 0;
    right: 0;
    background: var(--cp-card);
    z-index: 999;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* ============================================================
   MOBILE BOTTOM NAVIGATION
   ============================================================ */
.cp-mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--cp-mobile-nav-height);
    background-color: var(--cp-card);
    box-shadow: 0 -1px 0 var(--cp-border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 999;
}

.cp-mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    color: var(--cp-text-secondary) !important;
    font-size: 0.65rem;
    text-decoration: none !important;
    position: relative;
    transition: color 0.15s ease;
}

.cp-mobile-nav-item i {
    font-size: 1.2rem;
    margin-bottom: 2px;
}

.cp-mobile-nav-item.active {
    color: var(--cp-primary) !important;
}

.cp-mobile-badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 20px);
    background-color: var(--cp-danger);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.cp-main {
    padding-top: calc(var(--cp-navbar-height) + 16px);
    min-height: 100vh;
}

.cp-main.guest {
    padding-top: 0;
}

/* Auth pages need top padding for fixed navbar */
.auth-page {
    padding-top: var(--cp-navbar-height);
}

/* Landing page transparent navbar — applied via body.landing-page class set by JS */
body.landing-page .cp-navbar {
    background-color: transparent !important;
    box-shadow: none !important;
}

body.landing-page .cp-navbar .cp-navbar-brand {
    color: #fff !important;
}

body.landing-page .cp-navbar .cp-btn-login {
    color: #fff !important;
    border-color: rgba(255,255,255,0.3) !important;
}

body.landing-page .cp-navbar .cp-btn-login:hover {
    background-color: rgba(255,255,255,0.1) !important;
    border-color: rgba(255,255,255,0.5) !important;
}

body.landing-page .cp-navbar .cp-btn-register {
    background-color: var(--cp-primary) !important;
    border-color: var(--cp-primary) !important;
    color: #fff !important;
}

body.landing-page .cp-navbar .cp-btn-register:hover {
    background-color: var(--cp-primary-dark) !important;
    border-color: var(--cp-primary-dark) !important;
}

@media (max-width: 991.98px) {
    .cp-main.authenticated {
        padding-bottom: calc(var(--cp-mobile-nav-height) + 16px);
    }
}

/* ============================================================
   POST CARD
   ============================================================ */
.post-card {
    background-color: var(--cp-card);
    border-radius: var(--cp-radius);
    box-shadow: var(--cp-shadow);
    margin-bottom: 16px;
    overflow: hidden;
}

.post-card-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 10px;
}

.post-card-header .post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.post-card-header .post-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cp-primary), #c44a20);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.post-card-header .post-info {
    flex: 1;
    min-width: 0;
}

.post-card-header .post-author {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--cp-text);
    text-decoration: none;
    display: block;
    line-height: 1.3;
}

.post-card-header .post-author:hover {
    text-decoration: underline;
}

.post-card-header .post-meta {
    font-size: 0.75rem;
    color: var(--cp-text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-card-header .post-options {
    color: var(--cp-text-secondary);
    background: none;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.post-card-header .post-options:hover {
    background-color: var(--cp-hover);
}

.post-card-content {
    padding: 0 16px 12px;
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.post-card-content p:last-child {
    margin-bottom: 0;
}

.post-card-image {
    width: 100%;
    overflow: hidden;
    cursor: pointer;
    transition: filter 0.2s ease;
    line-height: 0;
}

.post-card-image img {
    width: 100%;
    max-height: 600px;
    object-fit: cover;
    display: block;
}

.post-card-image:hover {
    filter: brightness(0.97);
}

.post-card-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    font-size: 0.85rem;
    color: var(--cp-text-secondary);
}

.post-card-stats .like-count {
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-card-stats .like-count .like-icon-small {
    width: 18px;
    height: 18px;
    background-color: var(--cp-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.6rem;
}

.post-card-actions {
    display: flex;
    border-top: 1px solid var(--cp-border);
    margin: 0 16px;
    padding: 4px 0;
}

.post-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 0;
    border-radius: 6px;
    background: none;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--cp-text-secondary);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.post-action-btn:hover {
    background-color: var(--cp-hover);
}

.post-action-btn.liked {
    color: var(--cp-primary);
}

.post-action-btn i {
    font-size: 1.1rem;
}

/* Comment Section */
.post-comments {
    padding: 8px 16px 12px;
    border-top: 1px solid var(--cp-border);
    margin: 0;
    padding-left: 16px;
    padding-right: 16px;
}

.comment-item {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.comment-item .comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.comment-item .comment-avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--cp-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.7rem;
    flex-shrink: 0;
}

.comment-item .comment-body {
    background-color: var(--cp-bg);
    border-radius: 18px;
    padding: 8px 12px;
    max-width: 100%;
}

.comment-item .comment-author {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--cp-text);
    text-decoration: none;
}

.comment-item .comment-author:hover {
    text-decoration: underline;
}

.comment-item .comment-text {
    font-size: 0.85rem;
    color: var(--cp-text);
    margin: 0;
    word-wrap: break-word;
}

.comment-item .comment-actions {
    display: flex;
    gap: 12px;
    margin-top: 2px;
    padding-left: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--cp-text-secondary);
}

.comment-item .comment-actions a {
    color: var(--cp-text-secondary);
    text-decoration: none;
}

.comment-item .comment-actions a:hover {
    text-decoration: underline;
}

/* Comment Input */
.comment-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px 12px;
}

.comment-input-wrapper .comment-input-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.comment-input-wrapper .comment-input {
    flex: 1;
    background-color: var(--cp-bg);
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 0.85rem;
    outline: none;
    resize: none;
    min-height: 36px;
    max-height: 120px;
    transition: background-color 0.2s ease;
}

.comment-input-wrapper .comment-input:focus {
    background-color: var(--cp-bg);
    box-shadow: 0 0 0 2px var(--cp-primary-light);
}

.comment-input-wrapper .comment-input::placeholder {
    color: var(--cp-text-secondary);
}

.comment-send-btn {
    background: none;
    border: none;
    color: var(--cp-primary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.comment-send-btn:hover,
.comment-send-btn.active {
    opacity: 1;
}

/* Create Post */
.create-post-card {
    background-color: var(--cp-card);
    border-radius: var(--cp-radius);
    box-shadow: var(--cp-shadow);
    margin-bottom: 16px;
    padding: 12px 16px;
}

.create-post-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.create-post-input {
    flex: 1;
    background-color: var(--cp-bg);
    border: none;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 0.95rem;
    cursor: pointer;
    color: var(--cp-text-secondary);
    transition: background-color 0.2s ease;
}

.create-post-input:hover {
    background-color: var(--cp-hover);
}

.create-post-actions {
    display: flex;
    border-top: 1px solid var(--cp-border);
    padding-top: 8px;
    justify-content: space-around;
}

.create-post-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 6px;
    background: none;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--cp-text-secondary);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.create-post-action-btn:hover {
    background-color: var(--cp-hover);
}

.create-post-action-btn .icon-video {
    color: #e4002b;
}

.create-post-action-btn .icon-photo {
    color: var(--cp-success);
}

.create-post-action-btn .icon-feeling {
    color: #f5c518;
}

/* Post Textarea (expanded) */
.create-post-textarea {
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    font-size: 1.1rem;
    min-height: 100px;
    padding: 12px 0;
    font-family: inherit;
}

.create-post-textarea::placeholder {
    color: var(--cp-text-secondary);
}

/* ============================================================
   PROFILE
   ============================================================ */
.profile-cover {
    width: 100%;
    height: 350px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-radius: 0 0 var(--cp-radius) var(--cp-radius);
    overflow: hidden;
    position: relative;
}

.profile-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-cover-overlay {
    position: absolute;
    bottom: 16px;
    right: 16px;
}

.profile-header {
    max-width: 940px;
    margin: 0 auto;
    padding: 0 16px;
    position: relative;
}

.profile-avatar-wrapper {
    position: relative;
    margin-top: -84px;
    display: inline-block;
}

.profile-avatar-wrapper .avatar-xl {
    border: 4px solid var(--cp-card);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.profile-avatar-edit {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--cp-hover);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--cp-shadow);
}

.profile-info {
    padding: 12px 0 16px;
    border-bottom: 1px solid var(--cp-border);
}

.profile-name {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 4px;
}

.profile-bio {
    font-size: 0.95rem;
    color: var(--cp-text-secondary);
    margin-bottom: 8px;
}

.profile-stats {
    display: flex;
    gap: 16px;
    font-size: 0.9rem;
    color: var(--cp-text-secondary);
}

.profile-stats strong {
    color: var(--cp-text);
}

.profile-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.profile-actions .btn {
    font-weight: 600;
    border-radius: 6px;
    padding: 8px 20px;
    font-size: 0.9rem;
}

.profile-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--cp-border);
    padding: 4px 0;
    margin-top: 4px;
}

.profile-tab {
    padding: 12px 16px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--cp-text-secondary);
    text-decoration: none;
    border-radius: var(--cp-radius) var(--cp-radius) 0 0;
    border-bottom: 3px solid transparent;
    transition: background-color 0.2s ease;
}

.profile-tab:hover {
    background-color: var(--cp-hover);
    color: var(--cp-primary);
}

.profile-tab.active {
    color: var(--cp-primary);
    border-bottom-color: var(--cp-primary);
}

/* ============================================================
   FRIEND CARD
   ============================================================ */
.friends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.friend-card {
    background-color: var(--cp-card);
    border-radius: var(--cp-radius);
    box-shadow: var(--cp-shadow);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.friend-card:hover {
    box-shadow: var(--cp-shadow-lg);
}

.friend-card-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background-color: var(--cp-bg);
}

.friend-card-img-placeholder {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(135deg, #1a1a2e, var(--cp-bg));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--cp-primary);
}

.friend-card-body {
    padding: 12px;
}

.friend-card-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--cp-text);
    text-decoration: none;
    display: block;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friend-card-name:hover {
    text-decoration: underline;
}

.friend-card-mutual {
    font-size: 0.75rem;
    color: var(--cp-text-secondary);
    margin-bottom: 10px;
}

.friend-card-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.friend-card-actions .btn {
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px;
    padding: 6px 0;
}

.btn-confirm {
    background-color: var(--cp-primary);
    color: #fff;
    border: none;
}

.btn-confirm:hover {
    background-color: var(--cp-primary-dark);
    color: #fff;
}

.btn-decline {
    background-color: var(--cp-hover);
    color: var(--cp-text);
    border: none;
}

.btn-decline:hover {
    background-color: var(--cp-hover);
}

/* ============================================================
   CHAT
   ============================================================ */
.chat-container {
    display: flex;
    height: calc(100vh - var(--cp-navbar-height));
    background-color: var(--cp-card);
    border-radius: var(--cp-radius);
    box-shadow: var(--cp-shadow);
    overflow: hidden;
}

/* Chat Sidebar */
.chat-sidebar {
    width: 360px;
    border-right: 1px solid var(--cp-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.chat-sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--cp-border);
}

.chat-sidebar-header h5 {
    font-weight: 800;
    font-size: 1.4rem;
    margin: 0 0 12px 0;
}

.chat-sidebar-search {
    position: relative;
}

.chat-sidebar-search input {
    width: 100%;
    height: 36px;
    border-radius: 50px;
    background-color: var(--cp-bg);
    border: none;
    padding-left: 36px;
    font-size: 0.85rem;
    outline: none;
}

.chat-sidebar-search input:focus {
    box-shadow: 0 0 0 2px var(--cp-primary-light);
}

.chat-sidebar-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--cp-text-secondary);
    font-size: 0.8rem;
}

.chat-thread-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.chat-thread {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--cp-radius);
    cursor: pointer;
    transition: background-color 0.15s ease;
    text-decoration: none;
    color: inherit;
}

.chat-thread:hover {
    background-color: var(--cp-hover);
    color: inherit;
}

.chat-thread.active {
    background-color: var(--cp-primary-light);
}

.chat-thread-avatar {
    position: relative;
    flex-shrink: 0;
}

.chat-thread-avatar img,
.chat-thread-avatar .avatar-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-thread-avatar .avatar-placeholder {
    background: linear-gradient(135deg, var(--cp-primary), #c44a20);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
}

.chat-thread-avatar .online-indicator {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--cp-success);
    border: 2px solid var(--cp-card);
}

.chat-thread-info {
    flex: 1;
    min-width: 0;
}

.chat-thread-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-thread-preview {
    font-size: 0.8rem;
    color: var(--cp-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-thread.unread .chat-thread-name {
    color: var(--cp-text);
}

.chat-thread.unread .chat-thread-preview {
    color: var(--cp-text);
    font-weight: 600;
}

.chat-thread-time {
    font-size: 0.7rem;
    color: var(--cp-text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}

.chat-thread-unread-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--cp-primary);
    flex-shrink: 0;
}

/* Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.chat-area-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--cp-border);
    flex-shrink: 0;
}

.chat-area-header img,
.chat-area-header .avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-area-header .chat-partner-name {
    font-weight: 700;
    font-size: 0.95rem;
}

.chat-area-header .chat-partner-status {
    font-size: 0.75rem;
    color: var(--cp-text-secondary);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 65%;
    margin-bottom: 2px;
}

.chat-message.sent {
    align-self: flex-end;
    align-items: flex-end;
}

.chat-message.received {
    align-self: flex-start;
    align-items: flex-start;
}

.chat-bubble {
    padding: 8px 14px;
    border-radius: 18px;
    font-size: 0.9rem;
    line-height: 1.4;
    word-wrap: break-word;
    max-width: 100%;
}

.chat-message.sent .chat-bubble {
    background-color: var(--cp-primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-message.received .chat-bubble {
    background-color: var(--cp-bg);
    color: var(--cp-text);
    border-bottom-left-radius: 4px;
}

.chat-message-time {
    font-size: 0.65rem;
    color: var(--cp-text-secondary);
    margin-top: 2px;
    padding: 0 8px;
}

.chat-date-divider {
    text-align: center;
    font-size: 0.75rem;
    color: var(--cp-text-secondary);
    margin: 16px 0;
    font-weight: 500;
}

/* Chat Input */
.chat-input-area {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--cp-border);
    flex-shrink: 0;
}

.chat-input-actions {
    display: flex;
    gap: 4px;
}

.chat-input-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: none;
    color: var(--cp-primary);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.chat-input-action-btn:hover {
    background-color: var(--cp-hover);
}

.chat-input {
    flex: 1;
    background-color: var(--cp-bg);
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 0.9rem;
    color: var(--cp-text);
    outline: none;
    resize: none;
    min-height: 36px;
    max-height: 120px;
    font-family: inherit;
}

.chat-input:focus {
    box-shadow: 0 0 0 2px var(--cp-primary-light);
}

.chat-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background-color: transparent;
    color: var(--cp-primary);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.chat-send-btn:hover {
    background-color: var(--cp-primary-light);
}

.chat-send-btn:disabled {
    color: var(--cp-border);
    cursor: not-allowed;
}

/* Chat Empty State */
.chat-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--cp-text-secondary);
}

.chat-empty i {
    font-size: 4rem;
    margin-bottom: 16px;
    color: var(--cp-border);
}

.chat-empty h5 {
    font-weight: 600;
    color: var(--cp-text);
}

/* ============================================================
   NOTIFICATIONS
   ============================================================ */
.notification-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--cp-radius);
    cursor: pointer;
    transition: background-color 0.15s ease;
    text-decoration: none;
    color: inherit;
}

.notification-item:hover {
    background-color: var(--cp-hover);
    color: inherit;
}

.notification-item.unread {
    background-color: var(--cp-primary-light);
}

.notification-item.unread:hover {
    background-color: rgba(224, 90, 43, 0.15);
}

.notification-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.notification-avatar-placeholder {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(224, 90, 43, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--cp-primary);
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-text {
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 2px;
}

.notification-text strong {
    font-weight: 600;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--cp-primary);
    font-weight: 600;
}

.notification-item:not(.unread) .notification-time {
    color: var(--cp-text-secondary);
    font-weight: 400;
}

.notification-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--cp-primary);
    flex-shrink: 0;
    align-self: center;
}

/* ============================================================
   SIDEBARS
   ============================================================ */
/* Left Sidebar */
.cp-sidebar-left {
    position: sticky;
    top: calc(var(--cp-navbar-height) + 16px);
    height: fit-content;
    max-height: calc(100vh - var(--cp-navbar-height) - 32px);
    overflow-y: auto;
    padding-right: 8px;
}

.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 8px;
    border-radius: var(--cp-radius);
    text-decoration: none;
    color: var(--cp-text);
    font-weight: 600;
    font-size: 0.9rem;
    transition: background-color 0.15s ease;
}

.sidebar-user-card:hover {
    background-color: var(--cp-hover);
    color: var(--cp-text);
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 8px;
    border-radius: var(--cp-radius);
    text-decoration: none !important;
    color: var(--cp-text) !important;
    font-weight: 500;
    font-size: 0.9rem;
    transition: background-color 0.15s ease;
}

.sidebar-nav-link:hover {
    background-color: var(--cp-hover);
}

.sidebar-nav-link i {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--cp-primary);
}

.sidebar-nav-link .icon-friends {
    color: #1877f2;
}

.sidebar-nav-link .icon-groups {
    color: #1877f2;
}

.sidebar-nav-link .icon-marketplace {
    color: #1877f2;
}

.sidebar-nav-link .icon-watch {
    color: #1877f2;
}

.sidebar-nav-link .icon-memories {
    color: #1877f2;
}

/* Right Sidebar */
.cp-sidebar-right {
    position: sticky;
    top: calc(var(--cp-navbar-height) + 16px);
    height: fit-content;
    max-height: calc(100vh - var(--cp-navbar-height) - 32px);
    overflow-y: auto;
    padding-left: 8px;
}

.sidebar-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--cp-text-secondary);
    padding: 8px;
    margin-bottom: 4px;
}

.sidebar-suggestion-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--cp-radius);
    transition: background-color 0.15s ease;
}

.sidebar-suggestion-card:hover {
    background-color: var(--cp-hover);
}

.sidebar-suggestion-card img,
.sidebar-suggestion-card .avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.sidebar-suggestion-info {
    flex: 1;
    min-width: 0;
}

.sidebar-suggestion-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--cp-text);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.sidebar-suggestion-name:hover {
    text-decoration: underline;
}

.sidebar-suggestion-mutual {
    font-size: 0.7rem;
    color: var(--cp-text-secondary);
}

/* Online Contacts */
.sidebar-contact {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--cp-radius);
    cursor: pointer;
    transition: background-color 0.15s ease;
    text-decoration: none;
    color: inherit;
}

.sidebar-contact:hover {
    background-color: var(--cp-hover);
    color: inherit;
}

.sidebar-contact-avatar {
    position: relative;
}

.sidebar-contact-avatar img,
.sidebar-contact-avatar .avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.sidebar-contact-avatar .avatar-placeholder {
    background: var(--cp-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.8rem;
}

.sidebar-contact-name {
    font-weight: 500;
    font-size: 0.85rem;
}

.sidebar-divider {
    height: 1px;
    background-color: var(--cp-border);
    margin: 8px;
}

/* ============================================================
   LANDING PAGE
   ============================================================ */
.landing-hero,
.hero-section {
    background: #0a0a0a;
    min-height: 100vh;
    display: flex;
    align-items: center;
    color: #fff;
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

/* Ambient glow effects */
.hero-section::before {
    content: '';
    position: absolute;
    top: -20%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(224, 90, 43, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    animation: floatGlow 8s ease-in-out infinite;
    pointer-events: none;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    right: -5%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(147, 51, 234, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    animation: floatGlow 10s ease-in-out infinite reverse;
    pointer-events: none;
}

@keyframes floatGlow {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -20px) scale(1.05); }
    66% { transform: translate(-20px, 15px) scale(0.95); }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.landing-hero h1,
.hero-section .hero-headline {
    font-size: 3.8rem;
    font-weight: 800;
    line-height: 1.08;
    margin-bottom: 20px;
    letter-spacing: -1px;
    position: relative;
    z-index: 1;
}

.hero-headline .hero-highlight {
    background: linear-gradient(135deg, #e05a2b, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.landing-hero p,
.hero-section .hero-subtext {
    font-size: 1.2rem;
    color: #8a8a8a;
    margin-bottom: 36px;
    max-width: 480px;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

.landing-hero .btn-lg {
    font-size: 1.1rem;
    font-weight: 700;
    padding: 14px 32px;
    border-radius: 8px;
}

.landing-hero .btn-light {
    color: var(--cp-primary);
}

.landing-hero .btn-outline-light:hover {
    color: var(--cp-primary);
}

/* Hero buttons */
.hero-btn-join {
    display: inline-block;
    font-size: 1.05rem;
    font-weight: 700;
    padding: 14px 36px;
    border-radius: 50px;
    background: linear-gradient(135deg, #e05a2b, #c44a20);
    color: #fff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    z-index: 1;
}

.hero-btn-join:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(224, 90, 43, 0.4);
    color: #fff;
}

.hero-btn-signin {
    display: inline-block;
    font-size: 1.05rem;
    font-weight: 700;
    padding: 14px 36px;
    border-radius: 50px;
    background-color: transparent;
    color: #ccc;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
}

.hero-btn-signin:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

/* Hero illustration */
.hero-illustration {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.landing-features,
.feature-section {
    padding: 80px 0;
    background-color: var(--cp-bg);
}

.feature-card {
    text-align: center;
    padding: 32px 24px;
    border-radius: var(--cp-radius-lg);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    background-color: var(--cp-card);
    border: 1px solid var(--cp-border);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border-color: rgba(224, 90, 43, 0.3);
}

.feature-card-icon {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    background: var(--cp-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 1.8rem;
    color: var(--cp-primary);
}

.feature-card h5,
.feature-card h3 {
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 1.1rem;
    color: var(--cp-text);
}

.feature-card p {
    color: var(--cp-text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* Landing Stats */
.landing-stats {
    padding: 60px 0;
    background-color: var(--cp-bg);
}

.stat-item {
    text-align: center;
    padding: 24px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--cp-primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--cp-text-secondary);
    margin-top: 8px;
}

/* ============================================================
   LOGIN / REGISTER
   ============================================================ */
.auth-container,
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    background-color: var(--cp-bg);
}

.auth-card {
    background-color: var(--cp-card);
    border-radius: var(--cp-radius-lg);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--cp-border);
    padding: 24px;
    width: 100%;
    max-width: 400px;
}

.auth-card-wide {
    max-width: 900px;
    display: flex;
    overflow: hidden;
    padding: 0;
}

.auth-card-info {
    flex: 1;
    background: linear-gradient(135deg, #1a1a2e, #0f3460);
    color: #fff;
    padding: 48px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-card-info h2 {
    font-weight: 800;
    font-size: 2rem;
    margin-bottom: 12px;
}

.auth-card-info p {
    opacity: 0.9;
    font-size: 1rem;
    line-height: 1.5;
}

.auth-card-form {
    flex: 1;
    padding: 48px 32px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 24px;
}

.auth-logo i {
    font-size: 2.5rem;
    color: var(--cp-primary);
}

.auth-logo h4,
.auth-logo h1 {
    font-weight: 800;
    color: var(--cp-primary);
    margin-top: 8px;
    font-size: 1.5rem;
}

.auth-tagline {
    text-align: center;
    color: var(--cp-text-secondary);
    font-size: 0.95rem;
    margin-bottom: 20px;
    line-height: 1.4;
}

.auth-title {
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 4px;
}

.auth-subtitle {
    text-align: center;
    color: var(--cp-text-secondary);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.auth-card .form-control {
    border-radius: 6px;
    padding: 12px 14px;
    font-size: 0.95rem;
    border: 1px solid var(--cp-border);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-card .form-control:focus {
    border-color: var(--cp-primary);
    box-shadow: 0 0 0 3px rgba(224, 90, 43, 0.15);
    background-color: var(--cp-bg-secondary);
    color: var(--cp-text);
}

.auth-card .form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--cp-text-secondary);
}

.auth-card .btn-primary {
    background-color: var(--cp-primary);
    border-color: var(--cp-primary);
    font-weight: 700;
    font-size: 1rem;
    padding: 12px;
    border-radius: 6px;
    width: 100%;
    transition: background-color 0.2s ease;
}

.auth-card .btn-primary:hover {
    background-color: var(--cp-primary-dark);
    border-color: var(--cp-primary-dark);
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: var(--cp-border);
}

.auth-divider span {
    padding: 0 12px;
    color: var(--cp-text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

.auth-card .btn-success {
    background-color: var(--cp-primary);
    border-color: var(--cp-primary);
    font-weight: 700;
    font-size: 1rem;
    padding: 12px 32px;
    border-radius: 6px;
}

.auth-card .btn-success:hover {
    background-color: var(--cp-primary-dark);
    border-color: var(--cp-primary-dark);
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.85rem;
    color: var(--cp-text-secondary);
}

.auth-footer a {
    font-weight: 600;
}

/* ============================================================
   AVATARS
   ============================================================ */
.avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-md {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-lg {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-xl {
    width: 168px;
    height: 168px;
    border-radius: 50%;
    object-fit: cover;
}

/* ============================================================
   UTILITY
   ============================================================ */
.online-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--cp-success);
    border: 2px solid var(--cp-card);
    display: inline-block;
}

.text-primary-cp {
    color: var(--cp-primary) !important;
}

.bg-primary-cp {
    background-color: var(--cp-primary) !important;
}

.bg-primary-light-cp {
    background-color: var(--cp-primary-light) !important;
}

.cp-card {
    background-color: var(--cp-card);
    border-radius: var(--cp-radius);
    box-shadow: var(--cp-shadow);
}

.cp-divider {
    border: none;
    height: 1px;
    background-color: var(--cp-border);
    margin: 0;
}

/* Empty State */
.cp-empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--cp-text-secondary);
}

.cp-empty-state i {
    font-size: 4rem;
    color: var(--cp-border);
    margin-bottom: 16px;
}

.cp-empty-state h5 {
    font-weight: 600;
    color: var(--cp-text);
    margin-bottom: 8px;
}

.cp-empty-state p {
    font-size: 0.9rem;
    max-width: 400px;
    margin: 0 auto;
}

/* Loading Spinner */
.cp-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.cp-spinner::after {
    content: '';
    width: 32px;
    height: 32px;
    border: 3px solid var(--cp-border);
    border-top-color: var(--cp-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Toasts / Alerts */
.cp-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    min-width: 300px;
    max-width: 400px;
    background-color: var(--cp-card);
    border-radius: var(--cp-radius);
    box-shadow: var(--cp-shadow-lg);
    padding: 16px;
    z-index: 2000;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================================
   SEARCH RESULTS
   ============================================================ */
.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--cp-radius);
    transition: background-color 0.15s ease;
    text-decoration: none;
    color: inherit;
}

.search-result-item:hover {
    background-color: var(--cp-hover);
    color: inherit;
}

.search-result-info h6 {
    font-weight: 600;
    margin: 0;
    font-size: 0.95rem;
}

.search-result-info p {
    font-size: 0.8rem;
    color: var(--cp-text-secondary);
    margin: 0;
}

/* ============================================================
   SETTINGS PAGE
   ============================================================ */
.settings-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--cp-radius);
    color: var(--cp-text);
    font-weight: 500;
    font-size: 0.9rem;
    transition: background-color 0.15s ease;
}

.settings-nav .nav-link:hover {
    background-color: var(--cp-hover);
}

.settings-nav .nav-link.active {
    background-color: var(--cp-primary-light);
    color: var(--cp-primary);
    font-weight: 600;
}

.settings-nav .nav-link i {
    width: 24px;
    text-align: center;
    font-size: 1rem;
}

.settings-content {
    background-color: var(--cp-card);
    border-radius: var(--cp-radius);
    box-shadow: var(--cp-shadow);
    padding: 24px;
}

.settings-section-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.settings-section-subtitle {
    font-size: 0.85rem;
    color: var(--cp-text-secondary);
    margin-bottom: 20px;
}

/* ============================================================
   FOOTER (Guest)
   ============================================================ */
.cp-footer {
    background-color: var(--cp-card);
    padding: 24px 0;
    border-top: 1px solid var(--cp-border);
    margin-top: 40px;
}

.cp-footer p {
    font-size: 0.85rem;
    color: var(--cp-text-secondary);
}

.cp-footer a {
    color: var(--cp-text-secondary);
    text-decoration: none;
}

.cp-footer a:hover {
    text-decoration: underline;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Large Desktop (1400px+) */
@media (min-width: 1400px) {
    .cp-search-input {
        width: 280px;
    }

    .cp-search-input:focus {
        width: 360px;
    }
}

/* Desktop (992px - 1399px) */
@media (min-width: 992px) and (max-width: 1399.98px) {
    .cp-nav-tab {
        min-width: 90px;
        padding: 0 12px;
    }
}

/* Tablet (768px - 991px) */
@media (max-width: 991.98px) {
    .cp-nav-center {
        display: none;
    }

    .cp-sidebar-left,
    .cp-sidebar-right {
        display: none;
    }

    .chat-layout .chat-sidebar {
        width: 100%;
    }

    .chat-layout .chat-area {
        display: none;
    }

    .chat-layout.has-active .chat-sidebar {
        display: none;
    }

    .chat-layout.has-active .chat-area {
        display: flex;
    }

    /* Hide mobile bottom nav on active chat */
    .chat-layout.has-active ~ .cp-mobile-nav,
    body:has(.chat-layout.has-active) .cp-mobile-nav {
        display: none !important;
    }

    .chat-layout {
        height: calc(100vh - var(--cp-navbar-height) - var(--cp-mobile-nav-height));
    }

    .chat-layout.has-active {
        height: calc(100vh - var(--cp-navbar-height));
    }

    .profile-cover {
        height: 250px;
    }
}

/* Mobile (576px - 767px) */
@media (max-width: 767.98px) {
    html {
        font-size: 14px;
    }

    .cp-search-form {
        display: none !important;
    }

    .profile-cover {
        height: 200px;
        border-radius: 0;
    }

    .profile-name {
        font-size: 1.5rem;
    }

    .avatar-xl {
        width: 120px;
        height: 120px;
    }

    .profile-avatar-wrapper {
        margin-top: -60px;
    }

    .landing-hero h1,
    .hero-section .hero-headline {
        font-size: 2.2rem;
    }

    .landing-hero p,
    .hero-section .hero-subtext {
        font-size: 1rem;
    }

    .friends-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .auth-card-wide {
        flex-direction: column;
    }

    .auth-card-info {
        padding: 32px 24px;
    }

    .auth-card-form {
        padding: 32px 24px;
    }
}

/* Small Mobile (< 576px) */
@media (max-width: 575.98px) {
    .cp-navbar-brand span {
        display: none;
    }

    .post-card-actions {
        margin: 0 8px;
    }

    .post-action-btn {
        font-size: 0.8rem;
        gap: 4px;
    }

    .friends-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .friend-card-body {
        padding: 8px;
    }

    .landing-hero,
    .hero-section {
        padding: 60px 0;
    }

    .landing-hero h1,
    .hero-section .hero-headline {
        font-size: 1.8rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .chat-input-actions {
        display: none;
    }
}

/* Print */
@media print {
    .cp-navbar,
    .cp-mobile-nav,
    .cp-sidebar-left,
    .cp-sidebar-right {
        display: none !important;
    }

    .cp-main {
        padding-top: 0 !important;
    }
}

/* ============================================================
   VIEW CLASS ALIASES
   Maps class names used in Razor views to existing CSS styles
   ============================================================ */

/* --- Feed Sidebar --- */
.feed-sidebar {
    position: sticky;
    top: calc(var(--cp-navbar-height) + 16px);
    height: fit-content;
}

.sidebar-nav { list-style: none; padding: 0; margin: 0; }
.sidebar-nav li { margin-bottom: 2px; }

/* Sidebar nav item link — used both as direct <a> and inside <li> */
.sidebar-nav-item,
.sidebar-nav-item a,
.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 8px;
    border-radius: var(--cp-radius);
    text-decoration: none !important;
    color: var(--cp-text) !important;
    font-weight: 600;
    font-size: 0.93rem;
    transition: background-color 0.2s ease;
    cursor: pointer;
}
.sidebar-nav-item:hover,
.sidebar-nav-item a:hover,
.sidebar-nav li a:hover {
    background-color: var(--cp-hover);
}

/* User card at top of sidebar */
a.sidebar-nav-item.mb-2 {
    padding: 10px 8px;
    border-radius: var(--cp-radius);
    margin-bottom: 4px !important;
}
a.sidebar-nav-item.mb-2 img {
    width: 36px; height: 36px;
    border: 2px solid var(--cp-primary-light);
}

/* --- Create Post Box (alias for .create-post-card) --- */
.create-post-box {
    background-color: var(--cp-card);
    border-radius: var(--cp-radius);
    box-shadow: var(--cp-shadow);
    margin-bottom: 16px;
    padding: 12px 16px;
}

/* --- Create Post Action (alias for .create-post-action-btn) --- */
.create-post-action {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 6px;
    background: none;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--cp-text-secondary);
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-decoration: none;
}
.create-post-action:hover { background-color: var(--cp-hover); }

/* --- Post Card Header (views use .post-header instead of .post-card-header) --- */
.post-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 10px;
}

.post-header .post-avatar,
.post-header img {
    width: 40px; height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.post-header-info {
    flex: 1;
    min-width: 0;
}

.post-header-info .post-author,
.post-header-info a:first-child {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--cp-text);
    text-decoration: none;
    display: block;
    line-height: 1.3;
}

.post-header-info a:first-child:hover { text-decoration: underline; }

.post-meta {
    font-size: 0.75rem;
    color: var(--cp-text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-menu-btn {
    color: var(--cp-text-secondary);
    background: none;
    border: none;
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.post-menu-btn:hover { background-color: var(--cp-hover); }

/* --- Post Content (views use .post-content instead of .post-card-content) --- */
.post-content {
    padding: 0 16px 12px;
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
}

/* --- Post Image (views use .post-image instead of .post-card-image) --- */
.post-image {
    width: 100%;
    overflow: hidden;
    cursor: pointer;
    transition: filter 0.2s ease;
    line-height: 0; /* remove gap below image */
}
.post-image img {
    width: 100%;
    max-height: 600px;
    object-fit: cover;
    display: block;
}
.post-image:hover { filter: brightness(0.97); }

/* --- Post Stats (views use .post-stats instead of .post-card-stats) --- */
.post-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    font-size: 0.85rem;
    color: var(--cp-text-secondary);
    border-top: 1px solid var(--cp-border);
}

.post-stats .like-stats,
.post-stats .like-count {
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-stats .like-stats .like-icon-small {
    width: 18px; height: 18px;
    background-color: var(--cp-primary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 0.6rem;
}

/* --- Post Actions (views use .post-actions instead of .post-card-actions) --- */
.post-actions {
    display: flex;
    border-top: 1px solid var(--cp-border);
    margin: 0 16px;
    padding: 4px 0;
}

.post-actions .post-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 0;
    border-radius: 6px;
    background: none;
    border: none;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--cp-text-secondary);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.post-actions .post-action-btn:hover {
    background-color: var(--cp-hover);
    color: var(--cp-text);
}

.post-actions .post-action-btn i {
    font-size: 1.05rem;
}

/* --- Comment Section Aliases --- */
.comment-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0 4px;
}

.comment-input-row img,
.comment-input-row .comment-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.comment-input-row input,
.comment-input-row .form-control {
    flex: 1;
    background-color: var(--cp-bg);
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 0.85rem;
    outline: none;
    color: var(--cp-text);
}

.comment-input-row input::placeholder {
    color: var(--cp-text-secondary);
}

.comment-input-row input:focus {
    box-shadow: 0 0 0 2px rgba(224, 90, 43, 0.15);
    color: var(--cp-text);
    background-color: var(--cp-bg-secondary);
}

.comment-input-row form button[type="submit"] {
    background: none;
    border: none;
    color: var(--cp-primary);
    font-size: 0.95rem;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 50%;
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.comment-input-row form button[type="submit"]:hover {
    background-color: var(--cp-hover);
    transform: scale(1.1);
}

.comment-bubble {
    background-color: var(--cp-bg);
    border-radius: 18px;
    padding: 8px 12px;
    flex: 1;
}

.comment-bubble .comment-author,
.comment-bubble a:first-child {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--cp-text);
    text-decoration: none;
}

.comment-bubble a:first-child:hover { text-decoration: underline; }

.comment-meta {
    display: flex;
    gap: 12px;
    margin-top: 2px;
    padding-left: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--cp-text-secondary);
}

.comment-meta a {
    color: var(--cp-text-secondary);
    text-decoration: none;
}
.comment-meta a:hover { text-decoration: underline; }

/* --- Contact / Online Friends Sidebar --- */
.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--cp-radius);
    cursor: pointer;
    transition: background-color 0.15s ease;
    text-decoration: none;
    color: inherit;
}

.contact-item:hover { background-color: var(--cp-hover); color: inherit; }

.contact-avatar {
    position: relative;
    flex-shrink: 0;
}

.contact-avatar img,
.contact-avatar .avatar-placeholder {
    width: 36px; height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

/* --- Chat Layout --- */
.chat-layout {
    display: flex;
    height: calc(100vh - var(--cp-navbar-height));
    background-color: var(--cp-card);
    border-radius: var(--cp-radius);
    box-shadow: var(--cp-shadow);
    overflow: hidden;
}

/* --- Chat Thread Item (views use .chat-thread-item instead of .chat-thread) --- */
.chat-thread-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--cp-radius);
    cursor: pointer;
    transition: background-color 0.15s ease;
    text-decoration: none;
    color: inherit;
}

.chat-thread-item:hover { background-color: var(--cp-hover); color: inherit; }
.chat-thread-item.active { background-color: var(--cp-primary-light); }

.chat-thread-item.unread .chat-thread-name { color: var(--cp-text); }
.chat-thread-item.unread .chat-thread-preview { color: var(--cp-text); font-weight: 600; }

.chat-thread-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.chat-thread-unread {
    width: 10px; height: 10px;
    border-radius: 50%;
    background-color: var(--cp-primary);
    flex-shrink: 0;
}

/* --- Chat Message (views use .chat-msg instead of .chat-message) --- */
.chat-msg {
    display: flex;
    flex-direction: column;
    max-width: 65%;
    margin-bottom: 2px;
}

.chat-msg.sent { align-self: flex-end; align-items: flex-end; }
.chat-msg.received { align-self: flex-start; align-items: flex-start; }

.chat-msg-bubble {
    padding: 8px 14px;
    border-radius: 18px;
    font-size: 0.9rem;
    line-height: 1.4;
    word-wrap: break-word;
    max-width: 100%;
}

.chat-msg.sent .chat-msg-bubble {
    background-color: var(--cp-primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-msg.received .chat-msg-bubble {
    background-color: var(--cp-bg);
    color: var(--cp-text);
    border-bottom-left-radius: 4px;
}

.chat-msg-time {
    font-size: 0.65rem;
    color: var(--cp-text-secondary);
    margin-top: 2px;
    padding: 0 8px;
}

/* --- Chat Placeholder (no active chat selected) --- */
.chat-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--cp-text-secondary);
}

.chat-placeholder i {
    font-size: 4rem;
    margin-bottom: 16px;
    color: var(--cp-border);
}

.chat-placeholder h5 {
    font-weight: 600;
    color: var(--cp-text);
}

/* --- Profile Extras --- */
.profile-cover-btn {
    position: absolute;
    bottom: 8px; right: 8px;
    background: var(--cp-bg);
    border-radius: 50%;
    width: 36px; height: 36px;
    border: none;
    box-shadow: var(--cp-shadow);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background-color 0.2s;
}
.profile-cover-btn:hover { background-color: var(--cp-border); }

.profile-friend-count {
    font-size: 0.9rem;
    color: var(--cp-text-secondary);
}

/* --- Edit Profile --- */
.edit-profile-page {
    max-width: 680px;
    margin: 0 auto;
    padding: 20px 16px;
}

.edit-profile-card {
    background-color: var(--cp-card);
    border-radius: var(--cp-radius-lg);
    box-shadow: var(--cp-shadow);
    padding: 24px;
}

/* --- Friends Page --- */
.friends-page {
    max-width: 940px;
    margin: 0 auto;
    padding: 16px;
}

.friends-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.friends-section-header h5 {
    font-weight: 700;
    margin: 0;
}

.btn-add-friend {
    background-color: var(--cp-primary);
    border-color: var(--cp-primary);
    color: #fff;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 6px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}
.btn-add-friend:hover { background-color: var(--cp-primary-dark); color: #fff; }

.btn-remove {
    background-color: var(--cp-bg);
    border: 1px solid var(--cp-border);
    color: var(--cp-text);
    font-weight: 600;
    font-size: 0.8rem;
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.btn-remove:hover { background-color: var(--cp-border); }

/* --- Search Page --- */
.search-page {
    max-width: 680px;
    margin: 0 auto;
    padding: 20px 16px;
}

.search-header {
    margin-bottom: 20px;
}

.search-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--cp-border);
    padding-bottom: 4px;
}

.search-tab {
    padding: 8px 16px;
    border-radius: var(--cp-radius);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--cp-text-secondary);
    text-decoration: none;
    transition: background-color 0.15s;
    border: none;
    background: none;
    cursor: pointer;
}

.search-tab:hover { background-color: var(--cp-hover); }

.search-tab.active {
    color: var(--cp-primary);
    border-bottom: 3px solid var(--cp-primary);
    background-color: var(--cp-primary-light);
}

.no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--cp-text-secondary);
}

.no-results i {
    font-size: 3rem;
    color: var(--cp-border);
    margin-bottom: 12px;
    display: block;
}

.search-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--cp-radius);
    transition: background-color 0.15s;
    text-decoration: none;
    color: inherit;
}

.search-user-card:hover { background-color: var(--cp-hover); color: inherit; }

.search-user-card img {
    width: 48px; height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.search-user-info {
    flex: 1;
    min-width: 0;
}

.search-user-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--cp-text);
}

.search-user-meta {
    font-size: 0.8rem;
    color: var(--cp-text-secondary);
}

/* --- Notification Icon Colors --- */
.notification-icon {
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.9rem;
    position: absolute;
    bottom: -4px; right: -4px;
    border: 2px solid var(--cp-card);
}

.notification-icon.like { background-color: var(--cp-primary); color: #fff; }
.notification-icon.comment { background-color: var(--cp-success); color: #fff; }
.notification-icon.friend_request { background-color: var(--cp-primary); color: #fff; }
.notification-icon.friend_accept { background-color: var(--cp-success); color: #fff; }
.notification-icon.message { background-color: #a033ff; color: #fff; }

/* --- Online Dot --- */
.online-dot {
    position: absolute;
    bottom: 1px; right: 1px;
    width: 10px; height: 10px;
    border-radius: 50%;
    background-color: var(--cp-success);
    border: 2px solid var(--cp-card);
}

/* --- Create Post Modal --- */
.create-post-modal .modal-content {
    border-radius: var(--cp-radius-lg);
    border: none;
    box-shadow: var(--cp-shadow-lg);
}

/* ============================================================
   PROFESSIONAL VISUAL UPGRADE
   Animations, reactions, chat upgrade, micro-interactions
   ============================================================ */

/* ---- Post Card Hover Lift ---- */
.post-card {
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.post-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Post fadeIn on load */
.post-card { animation: fadeInUp 0.4s ease both; }
.post-card:nth-child(2) { animation-delay: 0.08s; }
.post-card:nth-child(3) { animation-delay: 0.16s; }
.post-card:nth-child(4) { animation-delay: 0.24s; }

/* ---- Post Header Avatar with Online Dot ---- */
.post-header {
    position: relative;
}

.post-header .avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.post-header .avatar-wrapper .online-dot {
    width: 10px; height: 10px;
    bottom: 0; right: 0;
    border: 2px solid var(--cp-card);
    animation: pulse 2s infinite;
}

/* ---- Better Post Action Buttons ---- */
.post-action-btn {
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
    position: relative;
    overflow: hidden;
}

.post-action-btn:active {
    transform: scale(0.95);
}

.post-action-btn.liked {
    color: var(--cp-primary);
    font-weight: 700;
}

.post-action-btn.liked.love { color: #e4405f; }
.post-action-btn.liked.haha { color: #f7b928; }
.post-action-btn.liked.wow { color: #f7b928; }
.post-action-btn.liked.sad { color: #f7b928; }
.post-action-btn.liked.angry { color: #e4002b; }

.post-action-btn.liked i {
    animation: heartBurst 0.4s ease;
}

/* ---- Reaction Picker ---- */
.reaction-wrapper {
    position: relative;
}

.reaction-picker {
    position: absolute;
    bottom: calc(100% + 4px);
    left: 0;
    display: none;
    background: var(--cp-card);
    border-radius: 28px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 6px 8px;
    gap: 0;
    z-index: 100;
    white-space: nowrap;
}

/* Invisible bridge between picker and button to prevent blink on mouse move */
.reaction-picker::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0; right: 0;
    height: 10px;
}

.reaction-picker.show {
    display: flex;
    animation: popIn 0.3s ease both;
}

.reaction-emoji {
    font-size: 1.6rem;
    cursor: pointer;
    padding: 4px 5px;
    border-radius: 50%;
    transition: transform 0.15s ease;
    background: none;
    border: none;
    outline: none;
    line-height: 1;
}

.reaction-emoji:hover {
    transform: scale(1.4) translateY(-4px);
}

.reaction-emoji:active {
    transform: scale(1.1);
}

.reaction-emoji:focus {
    outline: none;
}

/* Reaction label colors */
.reaction-label { font-size: 0.85rem; font-weight: 600; }
.reaction-label.like { color: var(--cp-primary); }
.reaction-label.love { color: #e4405f; }
.reaction-label.haha, .reaction-label.wow, .reaction-label.sad { color: #f7b928; }
.reaction-label.angry { color: #e4002b; }

/* Reaction summary icons in post stats */
.reaction-summary {
    display: flex;
    align-items: center;
    gap: 2px;
}

.reaction-summary .reaction-icon {
    width: 20px; height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    margin-right: -4px;
    border: 2px solid var(--cp-card);
    position: relative;
}

.reaction-icon.like-icon { background: var(--cp-primary); color: #fff; }
.reaction-icon.love-icon { background: #e4405f; color: #fff; }
.reaction-icon.haha-icon { background: #f7b928; color: #fff; }

/* ---- Comment Section Smooth Expand ---- */
.post-comments {
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
}

.comment-item {
    animation: fadeInUp 0.3s ease both;
}

/* ---- Button Tactile Press ---- */
.btn:active,
.cp-icon-btn:active,
.post-action-btn:active,
.create-post-action:active,
.create-post-action-btn:active {
    transform: scale(0.96);
}

/* ---- Primary Button Gradient ---- */
.btn-primary {
    background: linear-gradient(135deg, var(--cp-primary), var(--cp-primary-dark));
    border: none;
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.btn-primary:hover {
    box-shadow: 0 4px 12px rgba(224, 90, 43, 0.35);
    background: linear-gradient(135deg, #e86a3e, var(--cp-primary));
}

/* ---- Input Focus Glow ---- */
.form-control, .form-select {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--cp-primary);
    box-shadow: 0 0 0 3px rgba(224, 90, 43, 0.15);
    background-color: var(--cp-bg-secondary);
    color: var(--cp-text);
}

/* ---- Sidebar Nav Item Icons (circle backgrounds like Facebook) ---- */
.sidebar-nav-item i,
.sidebar-nav-item a i,
.sidebar-nav-link i {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    transition: background-color 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}

/* Default icon circle color */
.sidebar-nav-item i,
.sidebar-nav-item a i,
.sidebar-nav-link i {
    background: var(--cp-primary-light);
    color: var(--cp-primary);
}

/* Per-icon colors (dark theme) */
.sidebar-nav .fa-user-friends { background: rgba(59, 130, 246, 0.15) !important; color: #60a5fa !important; }
.sidebar-nav .fa-comment-dots { background: rgba(147, 51, 234, 0.15) !important; color: #a78bfa !important; }
.sidebar-nav .fa-bell { background: rgba(239, 68, 68, 0.15) !important; color: #f87171 !important; }
.sidebar-nav .fa-cog { background: rgba(156, 163, 175, 0.15) !important; color: #9ca3af !important; }
.sidebar-nav .fa-video { background: rgba(59, 130, 246, 0.15) !important; color: #60a5fa !important; }
.sidebar-nav .fa-bookmark { background: rgba(147, 51, 234, 0.15) !important; color: #a78bfa !important; }
.sidebar-nav .fa-calendar { background: rgba(245, 158, 11, 0.15) !important; color: #fbbf24 !important; }
.sidebar-nav .fa-store { background: rgba(34, 197, 94, 0.15) !important; color: #4ade80 !important; }
.sidebar-nav .fa-gamepad { background: rgba(59, 130, 246, 0.15) !important; color: #60a5fa !important; }
.sidebar-nav .fa-flag { background: rgba(239, 68, 68, 0.15) !important; color: #f87171 !important; }

.sidebar-nav-item:hover i,
.sidebar-nav-item a:hover i,
.sidebar-nav-link:hover i {
    transform: scale(1.08);
}

/* ---- Suggestion Card Hover ---- */
.sidebar-suggestion-card {
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.sidebar-suggestion-card:hover {
    transform: translateX(4px);
}

/* ---- Online Dot Pulse ---- */
.online-dot,
.chat-thread-avatar .online-indicator {
    animation: pulse 2s ease-in-out infinite;
}

/* ---- Navbar Avatar Fix ---- */
.cp-avatar-img {
    width: 36px; height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--cp-border);
    transition: border-color 0.2s ease;
}

.cp-avatar-btn:hover .cp-avatar-img {
    border-color: var(--cp-primary);
}

.cp-avatar-btn {
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
}

.cp-avatar-btn::after { display: none; } /* Remove dropdown arrow */

/* ---- Search Input Expand ---- */
.cp-search-input {
    transition: width 0.3s ease, box-shadow 0.2s ease;
    width: 220px;
    color: var(--cp-text);
}

.cp-search-input:focus {
    width: 300px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    color: var(--cp-text);
}

/* ---- Nav Badge Bounce ---- */
.cp-nav-badge, .cp-badge-dot, .cp-mobile-badge {
    animation: bounce 0.5s ease;
}

/* ---- Nav Tab Active Glow ---- */
.cp-nav-tab.active {
    position: relative;
}

.cp-nav-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0; left: 10%; right: 10%;
    height: 3px;
    background: var(--cp-primary);
    border-radius: 3px 3px 0 0;
    box-shadow: 0 -2px 8px rgba(224, 90, 43, 0.3);
}

/* ---- Chat Input Bar Redesign ---- */
.chat-input-area {
    display: flex;
    align-items: flex-end;
    padding: 10px 12px;
    gap: 6px;
    background: var(--cp-card);
    border-top: 1px solid var(--cp-border);
    flex-shrink: 0;
}

.chat-input-bar {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    flex: 1;
    background: var(--cp-bg);
    border-radius: 22px;
    padding: 6px 12px;
    transition: box-shadow 0.2s ease;
}

.chat-input-bar:focus-within {
    box-shadow: 0 0 0 2px var(--cp-primary-light);
}

.chat-input-bar textarea {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--cp-text);
    resize: none;
    font-size: 0.9rem;
    font-family: inherit;
    min-height: 24px;
    max-height: 120px;
    padding: 4px 0;
    outline: none;
    line-height: 1.4;
    caret-color: var(--cp-primary);
}

.chat-input-bar textarea::placeholder {
    color: var(--cp-text-secondary);
}

.chat-action-btn {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: none;
    background: none;
    color: var(--cp-primary);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background-color 0.15s ease, transform 0.15s ease;
    flex-shrink: 0;
}

.chat-action-btn:hover {
    background: var(--cp-primary-light);
}

.chat-action-btn:active {
    transform: scale(0.9);
}

.chat-send-btn-new {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--cp-primary);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background-color 0.2s ease, transform 0.15s ease;
    flex-shrink: 0;
}

.chat-send-btn-new:hover { background: var(--cp-primary-dark); }
.chat-send-btn-new:active { transform: scale(0.9); }
.chat-send-btn-new:disabled { background: var(--cp-border); cursor: not-allowed; }

/* Like button when chat is empty (thumbs up) */
.chat-send-btn-new.thumbs-up {
    background: transparent;
    color: var(--cp-primary);
    font-size: 1.4rem;
}

.chat-send-btn-new.thumbs-up:hover { background: var(--cp-primary-light); }

/* ---- Chat Image Preview ---- */
.chat-image-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--cp-bg);
    border-top: 1px solid var(--cp-border);
}

.chat-image-preview img {
    width: 60px; height: 60px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--cp-border);
}

.chat-image-preview .remove-preview {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--cp-danger);
    color: #fff;
    border: none;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    position: absolute;
    top: -6px; right: -6px;
}

.chat-image-preview .preview-item {
    position: relative;
}

/* ---- Chat Bubble Image ---- */
.chat-msg-bubble img,
.chat-bubble img {
    max-width: 280px;
    border-radius: 12px;
    cursor: pointer;
    transition: filter 0.2s ease;
}

.chat-msg-bubble img:hover,
.chat-bubble img:hover {
    filter: brightness(0.9);
}

/* ---- Chat Message Animations ---- */
.chat-msg.sent,
.chat-message.sent {
    animation: slideInRight 0.3s ease both;
}

.chat-msg.received,
.chat-message.received {
    animation: slideInLeft 0.3s ease both;
}

/* ---- Typing Indicator ---- */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.8rem;
    color: var(--cp-text-secondary);
}

.typing-indicator .dots {
    display: flex;
    gap: 3px;
}

.typing-indicator .dots span {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--cp-text-secondary);
    animation: typingDot 1.4s ease-in-out infinite;
}

.typing-indicator .dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator .dots span:nth-child(3) { animation-delay: 0.4s; }

/* ---- Chat Read Receipt ---- */
.chat-read-status {
    font-size: 0.6rem;
    color: var(--cp-text-secondary);
    padding: 0 8px;
    margin-top: 1px;
}

.chat-read-status.seen { color: var(--cp-primary); }
.chat-read-status i { font-size: 0.55rem; }

/* ---- Chat Thread Active Accent ---- */
.chat-thread-item.active,
.chat-thread.active {
    border-left: 3px solid var(--cp-primary);
    background-color: var(--cp-primary-light);
}

/* ---- Skeleton Loader ---- */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--cp-radius);
}

.skeleton-circle {
    border-radius: 50%;
}

.skeleton-post {
    background: var(--cp-card);
    border-radius: var(--cp-radius);
    box-shadow: var(--cp-shadow);
    padding: 16px;
    margin-bottom: 16px;
}

.skeleton-post .skeleton-avatar {
    width: 40px; height: 40px;
}

.skeleton-post .skeleton-line {
    height: 12px;
    margin-bottom: 8px;
}

.skeleton-post .skeleton-line.short { width: 40%; }
.skeleton-post .skeleton-line.medium { width: 70%; }
.skeleton-post .skeleton-line.long { width: 100%; }

.skeleton-post .skeleton-image {
    height: 200px;
    width: 100%;
    margin-top: 12px;
}

/* ---- Friend Card Hover ---- */
.friend-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.friend-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* ---- Friend Button States ---- */
.btn-add-friend {
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.btn-add-friend:active { transform: scale(0.95); }

.btn-add-friend.sent {
    background-color: var(--cp-bg);
    color: var(--cp-text-secondary);
    border: 1px solid var(--cp-border);
}

/* Loading spinner for buttons */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px; height: 16px;
    top: 50%; left: 50%;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---- Profile Tab Animated Indicator ---- */
.profile-tabs {
    position: relative;
}

.profile-tab {
    transition: color 0.2s ease, background-color 0.2s ease;
    position: relative;
}

.profile-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: var(--cp-primary);
    border-radius: 3px 3px 0 0;
    animation: fadeInUp 0.2s ease;
}

/* ---- Profile Avatar Ring ---- */
.profile-avatar-wrapper img,
.profile-avatar-wrapper .avatar-xl {
    border: 4px solid var(--cp-card);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: box-shadow 0.3s ease;
}

.profile-avatar-wrapper:hover img,
.profile-avatar-wrapper:hover .avatar-xl {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* ---- Toast Notification Upgrade ---- */
.cp-toast {
    animation: slideInRight 0.4s ease both;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-left: 4px solid var(--cp-primary);
}

/* ---- Image Lightbox ---- */
.lightbox-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    animation: fadeInUp 0.2s ease;
}

.lightbox-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px; right: 20px;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}

/* ---- Comment Submit Flash ---- */
.comment-input-row input.flash-success {
    animation: commentFlash 0.6s ease;
}
@keyframes commentFlash {
    0% { background-color: inherit; }
    30% { background-color: rgba(66, 183, 42, 0.15); }
    100% { background-color: inherit; }
}

/* ---- New Comment Slide-In ---- */
.comment-item.new-comment {
    animation: fadeInUp 0.3s ease both;
}

/* ---- Delete Post Fade Out ---- */
.post-card.deleting {
    animation: deleteFade 0.4s ease forwards;
}
@keyframes deleteFade {
    to { opacity: 0; transform: scale(0.95); height: 0; margin: 0; padding: 0; overflow: hidden; }
}

/* ---- Friend Request Button Transitions ---- */
.friend-action-btn {
    transition: all 0.3s ease;
}
.friend-action-btn.sent {
    background: var(--cp-bg) !important;
    color: var(--cp-text-secondary) !important;
    border-color: var(--cp-border) !important;
}
.friend-action-btn .fa-spinner {
    animation: spin 0.6s linear infinite;
}

/* ---- Smooth Comment Section Toggle ---- */
.post-comments {
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.25s ease;
}
.post-comments.collapsing {
    max-height: 0 !important;
    opacity: 0;
}

/* ---- Post Stats Hover ---- */
.post-stats .like-stats:hover {
    text-decoration: underline;
    cursor: pointer;
}

/* ---- Like Button Active State Colors ---- */
.post-action-btn.liked.like { color: #1877f2; }
.post-action-btn.liked.love { color: #e4405f; }
.post-action-btn.liked.haha,
.post-action-btn.liked.wow,
.post-action-btn.liked.sad { color: #f7b928; }
.post-action-btn.liked.angry { color: #e4002b; }

/* ---- Feed Load More Button ---- */
.btn-load-more {
    transition: all 0.3s ease;
    border-width: 2px;
}
.btn-load-more:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ---- Modal Smooth Open ---- */
.modal.fade .modal-dialog {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ---- Notification Item Hover ---- */
.notification-item {
    transition: background-color 0.15s ease;
}
.notification-item:hover {
    background-color: var(--cp-primary-light);
}
.notification-item.unread {
    border-left: 3px solid var(--cp-primary);
}

/* ---- Search Results Fade In ---- */
.search-result-item {
    animation: fadeInUp 0.3s ease both;
}
.search-result-item:nth-child(2) { animation-delay: 0.05s; }
.search-result-item:nth-child(3) { animation-delay: 0.10s; }
.search-result-item:nth-child(4) { animation-delay: 0.15s; }
.search-result-item:nth-child(5) { animation-delay: 0.20s; }

/* ---- Scrollbar Styling ---- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--cp-border);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ---- Empty State Styling ---- */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--cp-text-secondary);
}
.empty-state i {
    font-size: 3.5rem;
    color: var(--cp-border);
    margin-bottom: 16px;
    display: block;
}
.empty-state h6 {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--cp-text);
}

/* ---- Profile Cover Parallax-Lite ---- */
.profile-cover {
    overflow: hidden;
    position: relative;
}
.profile-cover img {
    transition: transform 0.3s ease;
}
.profile-cover:hover img {
    transform: scale(1.02);
}

/* ---- Profile Header Layout Fix ---- */
.profile-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px;
}
.profile-avatar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}
@media (min-width: 768px) {
    .profile-avatar-wrapper {
        flex-direction: row;
        gap: 20px;
    }
}

/* ---- Profile Actions Polish ---- */
.profile-actions {
    margin-left: auto;
    padding-bottom: 16px;
}
.profile-actions .btn {
    transition: all 0.2s ease;
    font-weight: 600;
}
.profile-actions .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ---- Profile Friend Count Pill ---- */
.profile-friend-count {
    display: inline-block;
    padding: 4px 12px;
    background: var(--cp-primary-light);
    color: var(--cp-primary) !important;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease;
}
.profile-friend-count:hover {
    background: var(--cp-primary);
    color: #fff !important;
}

/* ---- Friend Card Image Overlay ---- */
.friend-card a {
    position: relative;
    display: block;
    overflow: hidden;
}
.friend-card-img {
    transition: transform 0.3s ease;
}
.friend-card:hover .friend-card-img {
    transform: scale(1.05);
}

/* ---- Friend Card Equal Height ---- */
.friend-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.friend-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.friend-card-body .d-flex.gap-2 {
    margin-top: auto;
}

/* ---- Friends Tab Buttons ---- */
.friends-page .btn.active {
    box-shadow: 0 2px 8px rgba(24, 119, 242, 0.3);
}
.friends-page .btn-outline-secondary {
    transition: all 0.2s ease;
}
.friends-page .btn-outline-secondary:hover {
    background: var(--cp-hover);
    border-color: var(--cp-border);
    transform: translateY(-1px);
}

/* ---- Friends Request Card Accept Animation ---- */
.friend-card .fa-check-circle {
    animation: popIn 0.4s ease both;
}

/* ---- Selection Color ---- */
::selection {
    background-color: var(--cp-primary-light);
    color: var(--cp-primary-dark);
}

/* ============================================================
   STORIES
   ============================================================ */

/* ---- Story Tray ---- */
.story-tray {
    background: var(--cp-card);
    border-radius: var(--cp-radius-lg);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--cp-shadow);
    overflow: hidden;
}
.story-tray-inner {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 4px;
}
.story-tray-inner::-webkit-scrollbar { display: none; }

.story-bubble {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    flex-shrink: 0;
    width: 80px;
}
.story-avatar-wrap {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    padding: 3px;
    position: relative;
    background: var(--cp-border);
}
.story-avatar-wrap.story-ring-unviewed {
    background: linear-gradient(135deg, var(--cp-primary), #f5576c, #fda085);
}
.story-avatar-wrap.story-ring-viewed {
    background: var(--cp-border);
}
.story-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--cp-card);
}
.story-name {
    font-size: 0.72rem;
    color: var(--cp-text-secondary);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}
.story-add-btn {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--cp-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    border: 2px solid var(--cp-card);
}
.create-story .story-avatar-wrap { background: var(--cp-border); }

/* ---- Story Viewer ---- */
.story-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.story-viewer-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 16px 20px 10px;
    z-index: 10;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent);
}
.story-progress-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
}
.story-progress-seg {
    flex: 1;
    height: 3px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    overflow: hidden;
}
.story-progress-seg.done { background: #fff; }
.story-progress-seg.active {
    background: rgba(255,255,255,0.3);
    animation: storyProgress 5s linear forwards;
}
@keyframes storyProgress {
    from { background: linear-gradient(to right, #fff 0%, rgba(255,255,255,0.3) 0%); }
    to { background: linear-gradient(to right, #fff 100%, rgba(255,255,255,0.3) 100%); }
}
.story-viewer-user {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
}
.story-close-btn {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    z-index: 11;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}
.story-close-btn:hover { background: rgba(255,255,255,0.15); }

.story-viewer-content {
    width: 100%;
    max-width: 420px;
    height: 75vh;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
}
.story-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 10;
}
.story-nav-btn:hover { background: rgba(255,255,255,0.3); }
.story-nav-prev { left: max(20px, calc(50% - 240px)); }
.story-nav-next { right: max(20px, calc(50% - 240px)); }

.story-viewer-actions {
    position: absolute;
    right: max(20px, calc(50% - 230px));
    bottom: 80px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 15;
}
.story-action-btn {
    background: rgba(0,0,0,0.5);
    border: none;
    color: #fff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    gap: 2px;
    backdrop-filter: blur(4px);
}
.story-action-btn span { font-size: 11px; line-height: 1; }
.story-action-btn:hover { background: rgba(255,255,255,0.2); transform: scale(1.1); }
.story-action-btn.liked { color: #ff3b5c; }
.story-action-btn.liked i { animation: likePopStory 0.3s ease; }
@keyframes likePopStory { 0% { transform: scale(1); } 50% { transform: scale(1.4); } 100% { transform: scale(1); } }

.story-viewer-footer {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(480px, 100%);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 15;
}
.story-reply-bar {
    flex: 1;
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.12);
    border-radius: 24px;
    padding: 4px 4px 4px 16px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.15);
}
.story-reply-bar input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 14px;
    outline: none;
    padding: 6px 0;
}
.story-reply-bar input::placeholder { color: rgba(255,255,255,0.5); }
.story-send-btn {
    background: var(--cp-primary);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: background 0.2s;
}
.story-send-btn:hover { background: var(--cp-primary-hover); }
.story-view-count {
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    white-space: nowrap;
}

/* Story Comment Drawer */
.story-comment-drawer {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: min(480px, calc(100% - 32px));
    max-height: 50vh;
    background: rgba(20,20,30,0.95);
    border-radius: 16px 16px 0 0;
    display: flex;
    flex-direction: column;
    z-index: 20;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.1);
    animation: slideUpDrawer 0.25s ease;
}
@keyframes slideUpDrawer { from { transform: translateX(-50%) translateY(20px); opacity: 0; } to { transform: translateX(-50%) translateY(0); opacity: 1; } }
.story-comment-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: #fff;
}
.story-comment-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
    max-height: 40vh;
}
.story-comment-item {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    color: #fff;
}
.story-comment-item .avatar-xs { width: 28px; height: 28px; flex-shrink: 0; }
.story-comment-body { flex: 1; line-height: 1.4; }

/* ---- Create Story Modal ---- */
.story-text-preview {
    border-radius: 12px;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.story-text-input {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    text-align: center;
    resize: none;
    width: 100%;
    min-height: 120px;
    outline: none;
}
.story-text-input::placeholder { color: rgba(255,255,255,0.5); }

.story-bg-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
}
.story-bg-btn:hover { transform: scale(1.15); border-color: #fff; }

/* ============================================================
   REELS
   ============================================================ */

/* ---- Reels Container ---- */
.reels-container {
    position: fixed;
    top: var(--cp-navbar-height);
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    background: #000;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.reels-container::-webkit-scrollbar { display: none; }

.reels-feed {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ---- Reel Item ---- */
.reel-item {
    width: 100%;
    max-width: 480px;
    height: calc(100vh - var(--cp-navbar-height));
    scroll-snap-align: start;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    overflow: hidden;
}
.reel-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}
@media (min-width: 768px) {
    .reel-item { border-radius: 16px; margin: 8px 0; height: calc(100vh - var(--cp-navbar-height) - 16px); }
    .reel-video { border-radius: 16px; }
}

/* ---- Reel Overlay ---- */
.reel-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    pointer-events: none;
}
.reel-info {
    padding: 16px;
    padding-bottom: 24px;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
    pointer-events: auto;
}
.reel-author {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    margin-bottom: 8px;
}
.reel-author:hover { color: #fff; text-decoration: underline; }
.reel-caption {
    color: rgba(255,255,255,0.9);
    font-size: 0.9rem;
    margin: 0;
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ---- Reel Actions (right side) ---- */
.reel-actions {
    position: absolute;
    right: 12px;
    bottom: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    pointer-events: auto;
}
.reel-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 1.4rem;
    transition: transform 0.2s;
    padding: 0;
}
.reel-action-btn:hover { transform: scale(1.15); }
.reel-action-btn.liked { color: #e74c3c; }
.reel-action-btn.liked i { animation: heartPop 0.3s ease; }
@keyframes heartPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}
.reel-action-count {
    font-size: 0.75rem;
    font-weight: 600;
}
.reel-views {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ---- Reel Play/Pause ---- */
.reel-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
}
.reel-play-overlay i {
    font-size: 4rem;
    color: rgba(255,255,255,0.8);
    opacity: 0;
    transition: opacity 0.2s;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
.reel-play-overlay.paused i { opacity: 1; }

/* ---- Reel Mute ---- */
.reel-mute-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0,0,0,0.5);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    font-size: 0.9rem;
    transition: background 0.2s;
}
.reel-mute-btn:hover { background: rgba(0,0,0,0.7); }

/* ---- Reel Progress ---- */
.reel-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255,255,255,0.2);
    z-index: 5;
}
.reel-progress-bar {
    height: 100%;
    background: var(--cp-primary);
    transition: width 0.1s linear;
    width: 0%;
}

/* ---- Upload FAB ---- */
.reel-upload-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--cp-primary);
    color: #fff;
    border: none;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(224, 90, 43, 0.4);
    cursor: pointer;
    z-index: 100;
    transition: transform 0.2s, box-shadow 0.2s;
}
.reel-upload-fab:hover { transform: scale(1.1); box-shadow: 0 6px 24px rgba(224, 90, 43, 0.5); }

/* ---- Comment Drawer ---- */
.reel-comment-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 0;
    background: var(--cp-card);
    z-index: 9998;
    border-radius: 20px 20px 0 0;
    overflow: hidden;
    transition: height 0.3s ease;
}
.reel-comment-drawer.open { height: 60vh; }
.reel-comment-drawer-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.reel-comment-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--cp-border);
}
.reel-comment-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 20px;
}
.reel-comment-item {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}
.reel-comment-bubble {
    background: var(--cp-bg-secondary);
    border-radius: 12px;
    padding: 8px 12px;
}
.reel-comment-input-row {
    padding: 12px 20px;
    border-top: 1px solid var(--cp-border);
    display: flex;
    gap: 8px;
}

/* ---- Upload Modal ---- */
.reel-upload-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.85);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.reel-upload-card {
    background: var(--cp-card);
    border-radius: var(--cp-radius-lg);
    padding: 24px;
    max-width: 500px;
    width: 100%;
    box-shadow: var(--cp-shadow-lg);
}
.reel-upload-drop {
    border: 2px dashed var(--cp-border);
    border-radius: var(--cp-radius-lg);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.reel-upload-drop:hover {
    border-color: var(--cp-primary);
    background: rgba(224, 90, 43, 0.05);
}

/* ============================================================
   PROFILE PHOTO UPLOAD MODALS
   ============================================================ */
.photo-upload-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.85);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.photo-upload-card {
    background: var(--cp-card);
    border-radius: var(--cp-radius-lg);
    padding: 24px;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--cp-shadow-lg);
}
.photo-upload-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.photo-upload-img {
    max-width: 100%;
    max-height: 300px;
    object-fit: cover;
}
.photo-upload-img.rounded-circle {
    width: 200px;
    height: 200px;
}

/* ---- btn-close-white override for dark theme ---- */
.btn-close-white {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* ============================================================
   WATCH PAGE — Premium Video Hub
   ============================================================ */
.watch-container {
    position: fixed;
    top: var(--cp-navbar-height);
    left: 0; right: 0; bottom: 0;
    background: #000;
    z-index: 10;
}
.watch-feed {
    width: 100%;
    height: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.watch-feed::-webkit-scrollbar { display: none; }

.watch-item {
    position: relative;
    width: 100%;
    height: 100%;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Blurred cinematic background */
.watch-bg {
    position: absolute;
    inset: -20px;
    background-size: cover;
    background-position: center;
    filter: blur(30px) brightness(0.3) saturate(1.4);
    z-index: 0;
}

.watch-video {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: 100%;
    object-fit: contain;
    z-index: 1;
    cursor: pointer;
}

/* Overlay with bottom gradient */
.watch-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 0 16px 24px;
    background: linear-gradient(transparent 50%, rgba(0,0,0,0.7) 100%);
}

/* Bottom info */
.watch-info {
    pointer-events: auto;
    max-width: calc(100% - 80px);
    padding-right: 16px;
}
.watch-author {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    margin-bottom: 6px;
}
.watch-author:hover { color: #fff; text-decoration: none; }
.watch-author img { width: 40px; height: 40px; border: 2px solid rgba(255,255,255,0.3); }
.watch-source-badge {
    font-size: 10px;
    background: rgba(255,255,255,0.15);
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(4px);
}
.watch-caption {
    color: rgba(255,255,255,0.9);
    font-size: 14px;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Right side action buttons */
.watch-actions {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding-bottom: 20px;
}
.watch-action-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(.4,0,.2,1);
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.watch-action-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.12);
    box-shadow: 0 0 20px rgba(99,102,241,0.3);
}
.watch-action-btn.liked {
    color: #ff3b5c;
    background: rgba(255,59,92,0.15);
}
.watch-action-btn.liked i { animation: watchLikePop 0.4s cubic-bezier(.4,0,.2,1); }
@keyframes watchLikePop {
    0% { transform: scale(1); }
    30% { transform: scale(1.5); }
    60% { transform: scale(0.9); }
    100% { transform: scale(1); }
}
.watch-action-count {
    font-size: 11px;
    margin-top: 2px;
    font-weight: 600;
    line-height: 1;
}
.watch-view-count {
    color: rgba(255,255,255,0.6);
    font-size: 12px;
    text-align: center;
}

/* Play/Pause overlay */
.watch-play-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}
.watch-play-overlay i {
    font-size: 64px;
    color: rgba(255,255,255,0.8);
    filter: drop-shadow(0 4px 20px rgba(0,0,0,0.5));
    transition: transform 0.2s;
}
.watch-play-overlay:hover i { transform: scale(1.1); }

/* Mute button */
.watch-mute-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 5;
    background: rgba(0,0,0,0.5);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.watch-mute-btn:hover { background: rgba(255,255,255,0.2); }

/* Progress bar */
.watch-progress {
    position: absolute;
    bottom: 0;
    left: 0; right: 0;
    height: 3px;
    background: rgba(255,255,255,0.15);
    z-index: 5;
}
.watch-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--cp-primary), #a855f7);
    width: 0%;
    transition: width 0.1s linear;
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 8px rgba(99,102,241,0.5);
}

/* Upload FAB */
.watch-upload-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cp-primary), #a855f7);
    color: #fff;
    border: none;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    box-shadow: 0 4px 20px rgba(99,102,241,0.4);
    transition: all 0.3s;
    text-decoration: none;
}
.watch-upload-fab:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 30px rgba(99,102,241,0.6);
    color: #fff;
}

/* Double-tap heart burst */
.watch-heart-burst {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.watch-heart-burst i {
    font-size: 100px;
    color: #ff3b5c;
    opacity: 0;
    transform: scale(0.3);
}
.watch-heart-burst.animate i {
    animation: heartBurst 0.8s ease forwards;
}
@keyframes heartBurst {
    0% { opacity: 0; transform: scale(0.3); }
    15% { opacity: 1; transform: scale(1.3); }
    30% { transform: scale(0.95); }
    45% { opacity: 1; transform: scale(1.05); }
    100% { opacity: 0; transform: scale(1) translateY(-30px); }
}

/* Comment Drawer */
.watch-comment-drawer {
    position: fixed;
    bottom: 0;
    left: 0; right: 0;
    height: 0;
    background: rgba(15,15,25,0.97);
    z-index: 30;
    transition: height 0.35s cubic-bezier(.4,0,.2,1);
    overflow: hidden;
    border-radius: 20px 20px 0 0;
    backdrop-filter: blur(16px);
}
.watch-comment-drawer.open {
    height: 55vh;
}
.watch-comment-drawer-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}
.watch-comment-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    color: #fff;
}
.watch-comment-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 16px;
}
.watch-comment-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    color: #fff;
}
.watch-comment-item .avatar-xs { width: 32px; height: 32px; flex-shrink: 0; }
.watch-comment-body { flex: 1; line-height: 1.4; }
.watch-comment-input-row {
    padding: 10px 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.watch-comment-input-row input {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff;
    border-radius: 20px;
}
.watch-comment-input-row input::placeholder { color: rgba(255,255,255,0.4); }

/* Post video styling */
.post-video {
    margin: 0 -1px;
}
.post-video video {
    width: 100%;
    max-height: 500px;
    background: #000;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .watch-overlay { padding: 0 12px 16px; }
    .watch-action-btn { width: 44px; height: 44px; font-size: 18px; }
    .watch-actions { gap: 14px; }
    .watch-mute-btn { top: 12px; right: 12px; width: 36px; height: 36px; }
    .watch-upload-fab { bottom: 16px; right: 16px; width: 48px; height: 48px; }
    .watch-comment-drawer.open { height: 50vh; }
}

/* ============================================================
   CHAT DROPDOWN
   ============================================================ */

.cp-nav-tab-wrapper { display: flex; align-items: center; }

.cp-chat-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: -80px;
    width: 360px;
    background: var(--cp-card);
    border: 1px solid var(--cp-border);
    border-radius: var(--cp-radius-lg);
    box-shadow: var(--cp-shadow-lg);
    z-index: 1050;
    display: none;
    flex-direction: column;
    max-height: 480px;
    overflow: hidden;
}

.cp-chat-dropdown.open { display: flex; }

.cp-chat-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--cp-text);
    border-bottom: 1px solid var(--cp-border);
}

.cp-chat-dropdown-viewall {
    color: var(--cp-text-secondary);
    font-size: 0.9rem;
    text-decoration: none;
}
.cp-chat-dropdown-viewall:hover { color: var(--cp-primary); }

.cp-chat-dropdown-list {
    flex: 1;
    overflow-y: auto;
    max-height: 360px;
    scrollbar-width: thin;
}

.cp-chat-dd-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.15s;
}
.cp-chat-dd-item:hover { background: var(--cp-hover); }
.cp-chat-dd-item.unread { background: rgba(224, 90, 43, 0.06); }

.cp-chat-dd-avatar {
    position: relative;
    flex-shrink: 0;
}
.cp-chat-dd-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}
.cp-chat-dd-online {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 12px;
    height: 12px;
    background: var(--cp-success);
    border: 2px solid var(--cp-card);
    border-radius: 50%;
}

.cp-chat-dd-info { flex: 1; min-width: 0; }
.cp-chat-dd-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--cp-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cp-chat-dd-preview {
    font-size: 0.8rem;
    color: var(--cp-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cp-chat-dd-item.unread .cp-chat-dd-preview { color: var(--cp-text); font-weight: 600; }

.cp-chat-dd-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}
.cp-chat-dd-time {
    font-size: 0.72rem;
    color: var(--cp-text-secondary);
}
.cp-chat-dd-unread {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--cp-primary);
    color: #fff;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
}

.cp-chat-dropdown-footer {
    padding: 10px 16px;
    text-align: center;
    border-top: 1px solid var(--cp-border);
}
.cp-chat-dropdown-footer a {
    color: var(--cp-primary);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
}
.cp-chat-dropdown-footer a:hover { text-decoration: underline; }

/* ============================================================
   MINI CHAT WINDOWS
   ============================================================ */

#miniChatContainer {
    position: fixed;
    bottom: 0;
    right: 0;
    z-index: 1040;
    pointer-events: none;
}

.cp-mini-chat {
    position: fixed;
    bottom: 0;
    width: 328px;
    height: 455px;
    background: var(--cp-card);
    border: 1px solid var(--cp-border);
    border-bottom: none;
    border-radius: var(--cp-radius-lg) var(--cp-radius-lg) 0 0;
    box-shadow: var(--cp-shadow-lg);
    display: flex;
    flex-direction: column;
    pointer-events: all;
    transition: opacity 0.2s, transform 0.2s, height 0.25s;
    z-index: 1040;
}

.cp-mini-chat.minimized {
    height: 48px;
    overflow: hidden;
}

.cp-mini-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 8px 8px 12px;
    border-bottom: 1px solid var(--cp-border);
    cursor: pointer;
    flex-shrink: 0;
    min-height: 48px;
}

.cp-mini-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.cp-mini-avatar-wrap { position: relative; flex-shrink: 0; }
.cp-mini-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.cp-mini-online {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background: var(--cp-success);
    border: 2px solid var(--cp-card);
    border-radius: 50%;
}

.cp-mini-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--cp-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cp-mini-status {
    font-size: 0.7rem;
    color: var(--cp-success);
}

.cp-mini-header-actions {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}
.cp-mini-action-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--cp-text-secondary);
    border-radius: 50%;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}
.cp-mini-action-btn:hover { background: var(--cp-hover); color: var(--cp-primary); }

.cp-mini-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    scrollbar-width: thin;
}

.cp-mini-msg { display: flex; }
.cp-mini-msg.sent { justify-content: flex-end; }
.cp-mini-msg.received { justify-content: flex-start; }

.cp-mini-msg-bubble {
    max-width: 75%;
    padding: 8px 12px;
    border-radius: 18px;
    font-size: 0.84rem;
    line-height: 1.35;
    word-break: break-word;
}

.cp-mini-msg.sent .cp-mini-msg-bubble {
    background: var(--cp-primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.cp-mini-msg.received .cp-mini-msg-bubble {
    background: var(--cp-bg-secondary);
    color: var(--cp-text);
    border-bottom-left-radius: 4px;
}

.cp-mini-msg-img {
    max-width: 100%;
    border-radius: 10px;
    margin-bottom: 4px;
    display: block;
}

.cp-mini-input-area {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-top: 1px solid var(--cp-border);
    flex-shrink: 0;
}

.cp-mini-input {
    flex: 1;
    background: var(--cp-bg);
    border: none;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 0.84rem;
    color: var(--cp-text);
    outline: none;
}
.cp-mini-input::placeholder { color: var(--cp-text-secondary); }

.cp-mini-send {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--cp-primary);
    border-radius: 50%;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.cp-mini-send:hover { background: var(--cp-hover); }

/* Hide dropdown & mini chats on mobile */
@media (max-width: 991.98px) {
    .cp-chat-dropdown { display: none !important; }
    #miniChatContainer { display: none !important; }
}

/* ============================================================
   WEBRTC CALL OVERLAY
   ============================================================ */

.cp-call-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* Incoming call */
.cp-incoming-call {
    text-align: center;
    color: #fff;
}
.cp-incoming-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.2);
    animation: cp-pulse-ring 1.5s ease infinite;
}
@keyframes cp-pulse-ring {
    0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.3); }
    70% { box-shadow: 0 0 0 20px rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}
.cp-incoming-name {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 16px;
}
.cp-incoming-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
}
.cp-call-actions {
    display: flex;
    gap: 32px;
    margin-top: 40px;
}
.cp-call-action-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    font-size: 1.5rem;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, opacity 0.15s;
}
.cp-call-action-btn:hover { transform: scale(1.1); }
.cp-call-action-btn.accept { background: var(--cp-success); }
.cp-call-action-btn.reject { background: var(--cp-danger); }
.cp-call-action-btn.cancel { background: var(--cp-danger); }

/* Calling overlay */
.cp-calling {
    text-align: center;
    color: #fff;
}
.cp-calling-status {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 8px;
    animation: cp-dot-pulse 1.5s infinite;
}
@keyframes cp-dot-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Active call */
.cp-active-call {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: #000;
}

.cp-remote-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cp-remote-audio-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #fff;
}
.cp-remote-audio-avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.15);
    margin-bottom: 12px;
}

.cp-local-video {
    position: absolute;
    bottom: 100px;
    right: 20px;
    width: 160px;
    height: 120px;
    border-radius: var(--cp-radius-lg);
    border: 2px solid rgba(255, 255, 255, 0.2);
    object-fit: cover;
    z-index: 10001;
    cursor: move;
}

.cp-call-timer {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.4);
    padding: 4px 16px;
    border-radius: 20px;
    z-index: 10001;
}

.cp-call-controls {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    z-index: 10001;
    background: rgba(30, 30, 30, 0.7);
    backdrop-filter: blur(10px);
    padding: 12px 24px;
    border-radius: 40px;
}

.cp-call-control-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, transform 0.1s;
}
.cp-call-control-btn:hover { background: rgba(255, 255, 255, 0.25); transform: scale(1.05); }
.cp-call-control-btn.muted { background: var(--cp-danger); }
.cp-call-control-btn.end-call { background: var(--cp-danger); width: 60px; }
