/* =========================
   ROOT / GLOBAL
   ========================= */
:root {
    --app-bg: #f4f7fb;
    --app-surface: #ffffff;
    --app-text: #152033;
    --app-muted: #6b7280;
    --app-border: rgba(15, 23, 42, 0.08);
    --app-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    --app-shadow-soft: 0 10px 25px rgba(15, 23, 42, 0.05);
    --app-primary: #dc3545;
    --app-primary-dark: #bb2d3b;
}

/* =========================
   AUTH PAGES
   ========================= */
.auth-body {
    min-height: 100vh;
    background: linear-gradient(135deg, #ff4d4d, #b30000);
    display: flex;
    flex-direction: column;
}

.auth-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    border: none;
    border-radius: 16px;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    transition: all 0.3s ease;
    animation: fadeUp 0.6s ease forwards;
}

.auth-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.form-control {
    border-radius: 10px;
    padding: 12px;
    transition: all 0.2s ease;
}

.form-control:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2);
    border-color: #dc3545;
}

.btn-danger {
    border-radius: 10px;
    padding: 10px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(220, 53, 69, 0.3);
}

.show-password {
    border-radius: 0 10px 10px 0;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================
   APP SHELL
   ========================= */
.app-shell {
    min-height: 100vh;
    background:
        radial-gradient(900px 450px at 0% 0%, rgba(220,53,69,0.10), transparent 55%),
        radial-gradient(700px 400px at 100% 10%, rgba(220,53,69,0.05), transparent 50%),
        linear-gradient(180deg, #f8fafc 0%, var(--app-bg) 100%);
    color: var(--app-text);
}

.app-alerts {
    margin-top: 1rem;
}

/* =========================
   NAVBAR
   ========================= */
.app-navbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: rgba(220, 53, 69, 0.96);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 25px rgba(220,53,69,0.14);
}

.app-navbar-container {
    min-height: 82px;
}

.app-brand {
    text-decoration: none;
}

.app-brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.85rem 1.15rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.96);
    color: var(--app-primary);
    font-weight: 800;
    letter-spacing: -0.01em;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.app-brand:hover .app-brand-badge {
    transform: translateY(-2px);
    box-shadow: 0 14px 35px rgba(0,0,0,0.12);
}

.circle-dot,
.app-brand-dot {
    width: 12px;
    height: 12px;
    display: inline-block;
    border-radius: 50%;
    background: var(--app-primary);
    box-shadow: 0 0 0 6px rgba(220,53,69,0.12);
}

.app-nav-link {
    color: rgba(255,255,255,0.92) !important;
    font-weight: 600;
    padding: 0.6rem 0.95rem !important;
    border-radius: 999px;
    transition: background 0.2s ease, color 0.2s ease;
}

.app-nav-link:hover {
    background: rgba(255,255,255,0.12);
    color: #fff !important;
}

.app-nav-logout-btn {
    border: none;
    border-radius: 999px;
    background: #ffffff;
    color: var(--app-primary);
    font-weight: 700;
    padding: 0.72rem 1.2rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.app-nav-logout-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.10);
}

/* =========================
   PANELS / CARDS
   ========================= */
.app-panel,
.profile-empty-card {
    border: 1px solid var(--app-border);
    border-radius: 28px;
    background: rgba(255,255,255,0.92);
    box-shadow: var(--app-shadow);
    overflow: hidden;
}

.app-panel-soft {
    background: rgba(255,255,255,0.88);
    box-shadow: var(--app-shadow-soft);
}

.app-panel-cover {
    padding: 2rem 1.5rem 1.75rem;
    background:
        radial-gradient(600px 250px at 0% 0%, rgba(220,53,69,0.10), transparent 55%),
        linear-gradient(180deg, #fff 0%, #fff8f9 100%);
    border-bottom: 1px solid var(--app-border);
}

.app-section-kicker,
.profile-section-kicker {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--app-primary);
}

.app-side-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--app-text);
}

/* =========================
   HERO
   ========================= */
.app-hero-panel {
    background:
        radial-gradient(1000px 300px at 0% 0%, rgba(220,53,69,0.11), transparent 55%),
        linear-gradient(180deg, #ffffff 0%, #fffafb 100%);
}

.app-hero-title {
    font-size: clamp(1.7rem, 3vw, 2.35rem);
    line-height: 1.1;
    font-weight: 850;
    color: var(--app-text);
    letter-spacing: -0.03em;
}

.app-hero-title-sm {
    font-size: clamp(1.45rem, 2.4vw, 2rem);
}

.app-hero-text {
    color: var(--app-muted);
    font-size: 1rem;
    line-height: 1.75;
    max-width: 760px;
}

.app-hero-badge-wrap {
    flex-shrink: 0;
}

.app-hero-badge {
    min-width: 150px;
    padding: 1rem 1.15rem;
    border-radius: 24px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 18px 35px rgba(15, 23, 42, 0.08);
    text-align: center;
}

.app-hero-badge-sm {
    min-width: 160px;
}

.app-hero-badge-number {
    display: block;
    font-size: 1.2rem;
    font-weight: 850;
    color: var(--app-primary);
    line-height: 1;
    margin-bottom: 0.35rem;
}

.app-hero-badge-label {
    display: block;
    color: var(--app-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

/* =========================
   SIDEBAR / PROFILE
   ========================= */
.home-sidebar-avatar,
.profile-avatar {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    flex-shrink: 0;
}

.home-sidebar-avatar {
    width: 84px;
    height: 84px;
    margin: 0 auto;
    background: linear-gradient(135deg, #dc3545, #f06473);
    color: #fff;
    font-size: 1.9rem;
    box-shadow: 0 16px 34px rgba(220,53,69,0.22);
}

.profile-avatar {
    width: 118px;
    height: 118px;
    background: linear-gradient(135deg, #fdecef, #fff);
    color: var(--app-primary);
    font-size: 2.7rem;
    border: 6px solid #fff;
    box-shadow: 0 18px 35px rgba(15, 23, 42, 0.09);
}

.app-sidebar-name,
.profile-name {
    font-weight: 850;
    letter-spacing: -0.02em;
    color: var(--app-text);
}

.app-sidebar-email,
.profile-email {
    color: var(--app-muted);
}

.profile-name {
    font-size: 1.85rem;
}

.profile-bio {
    color: #495057;
    font-size: 1rem;
    line-height: 1.8;
    max-width: 520px;
    margin-inline: auto;
}

.profile-meta {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.profile-meta-item,
.app-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 0.95rem 1rem;
    border-radius: 18px;
    background: linear-gradient(180deg, #fdfefe, #f7f9fc);
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.profile-meta-label,
.app-stat-label {
    color: var(--app-muted);
    font-size: 0.92rem;
    font-weight: 600;
}

.profile-meta-value,
.app-stat-value {
    color: var(--app-text);
    font-size: 0.96rem;
    font-weight: 800;
}

/* =========================
   BUTTONS
   ========================= */
.app-primary-btn,
.profile-btn-primary {
    background: linear-gradient(135deg, var(--app-primary), var(--app-primary-dark));
    border: none;
    color: #fff;
    font-weight: 800;
    border-radius: 999px;
    padding: 0.85rem 1.25rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.app-primary-btn:hover,
.profile-btn-primary:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 18px 30px rgba(220,53,69,0.22);
}

.app-secondary-btn,
.profile-btn-secondary {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.10);
    color: var(--app-text);
    font-weight: 700;
    border-radius: 999px;
    padding: 0.85rem 1.25rem;
    transition: background 0.2s ease, transform 0.2s ease;
}

.app-secondary-btn:hover,
.profile-btn-secondary:hover {
    background: #f8fafc;
    transform: translateY(-1px);
}

.app-chip-btn {
    border-radius: 999px;
    padding: 0.62rem 1rem;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    color: #475569;
    font-weight: 600;
}

.acc-btn-outline-danger {
    border-radius: 999px;
    padding: 0.85rem 1.2rem;
    background: #fff;
    border: 1px solid rgba(220, 53, 69, 0.28);
    color: var(--app-primary);
    font-weight: 700;
    transition: all 0.2s ease;
}

.acc-btn-outline-danger:hover {
    background: rgba(220, 53, 69, 0.06);
    color: var(--app-primary-dark);
}

/* =========================
   CREATE / EDIT POST
   ========================= */
.create-post-card {
    background:
        radial-gradient(700px 180px at 0% 0%, rgba(220,53,69,0.07), transparent 55%),
        linear-gradient(180deg, #ffffff, #fffdfd);
    border: 1px solid var(--app-border);
    box-shadow: var(--app-shadow);
}

.create-post-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fdecef, #fff);
    color: var(--app-primary);
    font-size: 1.45rem;
    border: 1px solid rgba(220,53,69,0.14);
    box-shadow: 0 8px 20px rgba(220,53,69,0.10);
}

.create-post-textarea {
    background-color: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 18px;
    color: var(--app-text);
    font-size: 1.05rem;
    line-height: 1.85;
    padding: 1rem;
    resize: vertical;
    min-height: 140px;
    box-shadow: none !important;
}

#createPost,
#postContent.create-post-textarea {
    min-height: 180px;
}

.create-post-textarea::placeholder {
    color: #8a94a6;
}

.create-post-textarea:focus {
    background-color: #fff;
    border-color: rgba(220,53,69,0.22);
    box-shadow: 0 0 0 4px rgba(220,53,69,0.10) !important;
    color: var(--app-text);
}

.create-post-footer {
    padding-top: 1rem;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.create-post-hint {
    color: var(--app-muted);
    font-size: 0.93rem;
}

.create-post-btn {
    min-width: 140px;
}

/* =========================
   POSTS
   ========================= */
.home-post-card {
    background: rgba(255,255,255,0.96);
    overflow: hidden;
}

.home-post-card .card-body {
    padding: 1.5rem;
}

.home-post-avatar,
.post-mini-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fdecef, #fff);
    color: var(--app-primary);
    font-size: 1.15rem;
    font-weight: 800;
    flex-shrink: 0;
    border: 1px solid rgba(220,53,69,0.14);
    box-shadow: 0 8px 20px rgba(220,53,69,0.08);
}

.post-mini-avatar {
    width: 46px;
    height: 46px;
    font-size: 1rem;
}

.avatar-link {
    text-decoration: none;
    color: inherit;
}

.avatar-link:hover {
    text-decoration: none;
    color: inherit;
}

.post-author {
    font-size: 1rem;
    font-weight: 800;
    color: var(--app-text);
    text-decoration: none;
}

.post-author:hover {
    color: var(--app-primary);
}

.post-date {
    font-size: 0.88rem;
    color: var(--app-muted);
    margin-top: 0.15rem;
}

.post-menu-btn {
    color: #64748b;
    background: transparent;
    border: none;
    font-size: 1.3rem;
    line-height: 1;
    padding: 0;
}

.post-menu-btn:hover {
    color: var(--app-text);
    background: transparent;
}

.post-content {
    color: var(--app-text);
    font-size: 1rem;
    line-height: 1.9;
    white-space: pre-line;
}

.post-footer {
    padding-top: 1rem;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
}

/* =========================
   EMPTY STATE / COUNTER
   ========================= */
.profile-empty-icon {
    font-size: 3rem;
}

.profile-empty-title {
    color: var(--app-text);
    font-weight: 850;
}

.profile-empty-text {
    color: var(--app-muted);
    max-width: 420px;
    margin-inline: auto;
}

.char-counter {
    font-size: 0.9rem;
    color: #8a94a6;
    transition: 0.2s ease;
    font-weight: 700;
}

.char-counter.warning {
    color: #f59e0b;
}

.char-counter.danger {
    color: var(--app-primary);
}

/* =========================
   ACCOUNT PAGES
   ========================= */
.acc-name {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--app-text);
    letter-spacing: -0.02em;
}

.acc-email {
    color: var(--app-muted);
    font-size: 0.96rem;
}

.acc-bio {
    color: #4b5563;
    font-size: 0.95rem;
    line-height: 1.75;
}

.acc-danger-box {
    margin-top: 1.5rem;
    padding: 1.2rem;
    border-radius: 22px;
    background: linear-gradient(180deg, #fff8f8, #fff);
    border: 1px solid rgba(220, 53, 69, 0.14);
}

.acc-danger-title {
    color: var(--app-primary);
    font-weight: 800;
    margin-bottom: 0.2rem;
}

.acc-danger-text {
    color: var(--app-muted);
    font-size: 0.93rem;
    line-height: 1.65;
}

.acc-warn {
    font-size: 1.3rem;
    line-height: 1;
}

.app-input,
.acc-input {
    background-color: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    color: var(--app-text);
    min-height: 48px;
    padding: 0.8rem 1rem;
    box-shadow: none !important;
}

.app-input::placeholder,
.acc-input::placeholder {
    color: #94a3b8;
}

.app-input:focus,
.acc-input:focus {
    background-color: #fff;
    border-color: rgba(220, 53, 69, 0.24);
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.08) !important;
}

.acc-eye {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 1rem;
    padding: 0;
    line-height: 1;
}

.acc-eye:hover {
    color: var(--app-text);
}

.acc-forgot {
    color: var(--app-primary);
    text-decoration: none;
    font-weight: 600;
}

.acc-forgot:hover {
    color: var(--app-primary-dark);
}

/* account profile card fixed */
.acc-user-card-fixed {
    width: 100%;
}

.acc-user-row-fixed {
    display: flex;
    align-items: center;
    gap: 18px;
    width: 100%;
}

.acc-user-avatar-fixed {
    width: 88px;
    height: 88px;
    min-width: 88px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fdecef, #fff);
    color: #dc3545;
    font-size: 2rem;
    font-weight: 800;
    border: 1px solid rgba(220, 53, 69, 0.14);
    box-shadow: 0 8px 20px rgba(220, 53, 69, 0.08);
    flex-shrink: 0;
}

.acc-user-info-fixed {
    flex: 1;
    min-width: 0;
}

.acc-user-name-fixed {
    font-size: 1.2rem;
    font-weight: 800;
    color: #152033;
    line-height: 1.2;
    margin-bottom: 6px;
    word-break: break-word;
}

.acc-user-email-fixed {
    font-size: 0.95rem;
    color: #6b7280;
    line-height: 1.5;
    word-break: break-word;
}

.acc-user-bio-fixed {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.06);
    color: #4b5563;
    font-size: 0.95rem;
    line-height: 1.8;
    text-align: left;
    word-break: break-word;
}

/* =========================
   RESPONSIVE
   ========================= */
@media (max-width: 1199.98px) {
    .app-navbar-container {
        min-height: 76px;
    }
}

@media (max-width: 991.98px) {
    .profile-name {
        font-size: 1.55rem;
    }

    .app-hero-title {
        font-size: 1.8rem;
    }

    .app-panel,
    .profile-empty-card {
        border-radius: 24px;
    }
}

@media (max-width: 576px) {
    .app-brand-badge {
        padding: 0.72rem 1rem;
        font-size: 0.95rem;
    }

    .app-hero-title {
        font-size: 1.5rem;
    }

    .create-post-avatar,
    .home-post-avatar {
        width: 48px;
        height: 48px;
    }

    .home-sidebar-avatar {
        width: 72px;
        height: 72px;
        font-size: 1.5rem;
    }

    .acc-user-row-fixed {
        align-items: flex-start;
        gap: 14px;
    }

    .acc-user-avatar-fixed {
        width: 76px;
        height: 76px;
        min-width: 76px;
        font-size: 1.6rem;
    }

    .acc-user-name-fixed {
        font-size: 1.05rem;
    }

    .acc-user-email-fixed,
    .acc-user-bio-fixed {
        font-size: 0.92rem;
    }
}