/* ===============================================================
   Citizen Journalism — Unified Stylesheet
   Covers: Auth (Login, Register, Forgot/Reset Password),
           Profile, and Navbar Avatar Dropdown
   =============================================================== */

/* ---------------------------------------------------------------
   1. AUTH LAYOUT (shared across login, register, forgot, reset)
   --------------------------------------------------------------- */
.cj-auth-outer {
    min-height: 100vh;
    padding: 90px 30px 40px;
    background: #e8eaed;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cj-auth-card {
    display: flex;
    width: 100%;
    max-width: 1050px;
    min-height: 500px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
}

/* Left: Form Panel */
.cj-auth-form-panel {
    flex: 1;
    background: #fff;
    padding: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cj-auth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 35px;
}

.cj-auth-brand img {
    height: 32px;
}

.cj-auth-brand span {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #222;
}

/* Right: Branded Panel */
.cj-auth-brand-panel {
    flex: 0 0 45%;
    background: linear-gradient(135deg, #1a8c38 0%, #28a745 40%, #34c759 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 40px;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.cj-auth-brand-panel::before {
    content: '';
    position: absolute;
    top: -80px;
    right: -80px;
    width: 300px;
    height: 300px;
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
}

.cj-auth-brand-panel::after {
    content: '';
    position: absolute;
    bottom: -50px;
    left: -50px;
    width: 200px;
    height: 200px;
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

.cj-brand-icon {
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: #fff;
    margin-bottom: 25px;
    position: relative;
    z-index: 1;
}

.cj-brand-headline {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 22px;
    color: #fff;
    margin: 0 0 10px;
    position: relative;
    z-index: 1;
}

.cj-brand-tagline {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.75);
    margin: 0 0 25px;
    line-height: 1.6;
    max-width: 320px;
    position: relative;
    z-index: 1;
}

/* ---------------------------------------------------------------
   2. TYPOGRAPHY / FORM ELEMENTS (shared)
   --------------------------------------------------------------- */
.cj-form-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 26px;
    color: #222;
    margin: 0 0 6px;
}

.cj-form-subtitle {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    color: #999;
    margin: 0 0 28px;
    line-height: 1.6;
}

.cj-form-subtitle a {
    color: #28a745;
    font-weight: 600;
    text-decoration: none;
}

.cj-form-subtitle a:hover {
    text-decoration: underline;
}

/* Divider */
.cj-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
}

.cj-divider::before,
.cj-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e5e5;
}

.cj-divider span {
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    color: #bbb;
}

/* Alerts */
.cj-alert {
    padding: 11px 14px;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    margin-bottom: 18px;
    line-height: 1.5;
}

.cj-alert-danger {
    background: #fff5f5;
    color: #c53030;
    border-left: 4px solid #c53030;
}

.cj-alert-success {
    background: #f0fff4;
    color: #276749;
    border-left: 4px solid #28a745;
}

.cj-alert ul {
    margin: 4px 0 0;
    padding-left: 18px;
}

/* Form groups */
.cj-form-group {
    margin-bottom: 16px;
}

.cj-form-group label {
    display: block;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

/* Input with icon */
.cj-input-wrap {
    position: relative;
}

.cj-input-wrap i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #bbb;
    font-size: 14px;
}

.cj-input-wrap input {
    width: 100%;
    padding: 12px 14px 12px 40px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    color: #333;
    background: #fff;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.cj-input-wrap input:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

.cj-input-wrap input::placeholder {
    color: #bbb;
}

/* Form row (2 cols) */
.cj-form-row {
    display: flex;
    gap: 14px;
}

.cj-form-row .cj-form-group {
    flex: 1;
}

/* Forgot password link */
.cj-forgot-link {
    text-align: right;
    margin-bottom: 12px;
}

.cj-forgot-link a {
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    color: #28a745;
    text-decoration: none;
    font-weight: 500;
}

.cj-forgot-link a:hover {
    text-decoration: underline;
}

/* Primary button */
.cj-btn-primary {
    display: block;
    width: 100%;
    padding: 13px;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: #28a745;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 4px;
}

.cj-btn-primary:hover {
    background: #1e7e34;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.35);
    transform: translateY(-1px);
}

/* Form bottom */
.cj-form-bottom {
    text-align: center;
    margin-top: 20px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    color: #999;
}

.cj-form-bottom a {
    color: #222;
    font-weight: 600;
    text-decoration: underline;
}

/* ---------------------------------------------------------------
   3. CAPTCHA (Register page)
   --------------------------------------------------------------- */
.cj-captcha-box {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-radius: 10px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.cj-captcha-display {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 16px;
    min-width: 160px;
    height: 44px;
    user-select: none;
    -webkit-user-select: none;
}

.cj-captcha-display span {
    font-family: 'Courier New', 'Lucida Console', monospace;
    font-size: 24px;
    font-weight: 700;
    display: inline-block;
    letter-spacing: 3px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);
}

.cj-captcha-noise {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.cj-captcha-input {
    flex: 1;
    padding: 10px 12px;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #222;
    background: #fff;
    border: none;
    border-radius: 8px;
    text-align: center;
    letter-spacing: 3px;
    text-transform: none;
    outline: none;
}

/* ---------------------------------------------------------------
   4. FLOATING CARDS (Login & Register branded panel)
   --------------------------------------------------------------- */
.cj-float-elements {
    position: relative;
    width: 260px;
    height: 220px;
    margin-bottom: 30px;
}

.cj-float-card {
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    padding: 14px 18px;
}

.cj-float-card.card1 {
    top: 0;
    right: 0;
    width: 170px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: cjFloat1 4s ease-in-out infinite;
}

.cj-float-card.card2 {
    top: 70px;
    left: 0;
    width: 140px;
    animation: cjFloat2 5s ease-in-out infinite;
}

.cj-float-card.card3 {
    bottom: 0;
    right: 20px;
    width: 160px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: cjFloat3 4.5s ease-in-out infinite;
}

/* Unified icon names (login uses .cj-float-icon, register uses .cj-fi) */
.cj-float-icon,
.cj-fi {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

.cj-float-icon.green,
.cj-fi.gr {
    background: rgba(40, 167, 69, 0.12);
    color: #28a745;
}

.cj-float-icon.orange,
.cj-fi.or {
    background: rgba(240, 173, 78, 0.15);
    color: #f0ad4e;
}

.cj-float-icon.dark {
    background: rgba(34, 34, 34, 0.08);
    color: #222;
}

.cj-float-text,
.cj-ft {
    font-family: 'Poppins', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.cj-float-bar,
.cj-fb {
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    margin-top: 8px;
}

.cj-float-bar .fill,
.cj-fb .fill {
    height: 100%;
    border-radius: 3px;
    background: #28a745;
}

/* Dots indicator */
.cj-dots {
    display: flex;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.cj-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
}

.cj-dots span.active {
    background: #fff;
    width: 20px;
    border-radius: 4px;
}

/* Float animations (both cjFloat* and cjF* names) */
@keyframes cjFloat1 {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes cjFloat2 {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

@keyframes cjFloat3 {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes cjF1 {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes cjF2 {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

@keyframes cjF3 {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* ---------------------------------------------------------------
   5. PROFILE PAGE
   --------------------------------------------------------------- */
.cj-profile-wrapper {
    min-height: 100vh;
    padding: 140px 20px 60px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.cj-profile-container {
    max-width: 900px;
    margin: 0 auto;
}

/* Profile Hero */
.cj-profile-hero {
    background: #222;
    border-radius: 16px;
    padding: 35px 40px;
    display: flex;
    align-items: center;
    gap: 25px;
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
}

.cj-profile-hero::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 250px;
    height: 100%;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.cj-profile-avatar-wrap {
    flex-shrink: 0;
    position: relative;
}

.cj-profile-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #28a745;
}

.cj-profile-hero-info h2 {
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 22px;
    margin: 0 0 4px;
}

.cj-profile-hero-info p {
    color: rgba(255, 255, 255, 0.5);
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    margin: 0 0 10px;
}

.cj-hero-badge {
    display: inline-block;
    background: #28a745;
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cj-profile-hero-actions {
    margin-left: auto;
    position: relative;
    z-index: 1;
}

.cj-btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: rgba(220, 53, 69, 0.12);
    color: #ff6b6b;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid rgba(220, 53, 69, 0.2);
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.25s ease;
}

.cj-btn-logout:hover {
    background: #dc3545;
    color: #fff;
    border-color: #dc3545;
}

/* Edit Card */
.cj-edit-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.cj-edit-header {
    padding: 22px 35px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cj-edit-header h3 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 16px;
    color: #333;
    margin: 0;
}

.cj-edit-header .cj-edit-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(40, 167, 69, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #28a745;
    font-size: 14px;
}

.cj-edit-body {
    padding: 30px 35px 35px;
}

/* Profile edit layout */
.cj-edit-layout {
    display: flex;
    gap: 35px;
}

.cj-edit-sidebar {
    flex: 0 0 180px;
    text-align: center;
}

.cj-edit-main {
    flex: 1;
}

/* Avatar upload */
.cj-avatar-upload {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.cj-avatar-upload img {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e9ecef;
    transition: border-color 0.2s;
}

.cj-avatar-upload:hover img {
    border-color: #28a745;
}

.cj-avatar-overlay {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #28a745;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.cj-avatar-hint {
    font-family: 'Poppins', sans-serif;
    font-size: 11px;
    color: #999;
    margin-top: 8px;
    display: block;
}

/* Profile form control */
.cj-form-control {
    width: 100%;
    padding: 12px 14px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    color: #333;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    box-sizing: border-box;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    outline: none;
}

.cj-form-control:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.15);
    background: #fff;
}

.cj-form-control::placeholder {
    color: #adb5bd;
}

.cj-form-control:disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
}

textarea.cj-form-control {
    resize: vertical;
    min-height: 100px;
}

.cj-form-hint {
    display: block;
    margin-top: 5px;
    font-family: 'Poppins', sans-serif;
    font-size: 11px;
    color: #999;
}

/* Profile save button */
.cj-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 30px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: #222;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cj-btn:hover {
    background: #28a745;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

/* ---------------------------------------------------------------
   6. NAVBAR AVATAR DROPDOWN
   --------------------------------------------------------------- */
.cj-nav-avatar-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 10px;
    vertical-align: middle;
}

.cj-nav-avatar-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    border: 2.5px solid #28a745;
    transition: box-shadow 0.2s ease;
}

.cj-nav-avatar-btn:hover {
    box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.15);
}

.cj-nav-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 48px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.08);
    min-width: 220px;
    z-index: 9999;
    overflow: hidden;
    font-family: 'Poppins', sans-serif;
    text-align: left;
}

.cj-nav-dropdown.cj-dd-show {
    display: block;
    animation: cjDdFade 0.18s ease;
}

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

.cj-dd-user {
    padding: 16px 18px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.cj-dd-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.cj-dd-user-info {
    overflow: hidden;
}

.cj-dd-user-name {
    font-size: 13px;
    font-weight: 600;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.cj-dd-user-role {
    font-size: 11px;
    color: #28a745;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.cj-dd-menu {
    padding: 6px 0;
}

.cj-dd-menu a {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left !important;
    gap: 12px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    text-decoration: none;
    transition: background 0.15s ease;
}

.cj-dd-menu a:hover {
    background: #f8f9fa;
}

.cj-dd-menu a i {
    font-size: 16px;
    width: 20px;
    text-align: center;
    color: #666;
}

.cj-dd-menu a:hover i {
    color: #28a745;
}

.cj-dd-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 4px 0;
}

.cj-dd-menu a.cj-dd-logout {
    color: #dc3545;
}

.cj-dd-menu a.cj-dd-logout i {
    color: #dc3545;
}

.cj-dd-menu a.cj-dd-logout:hover {
    background: #fff5f5;
}

/* ---------------------------------------------------------------
   7. RESPONSIVE
   --------------------------------------------------------------- */
@media (max-width: 900px) {
    .cj-auth-card {
        flex-direction: column;
        max-width: 500px;
    }

    .cj-auth-brand-panel {
        flex: none;
        padding: 35px 25px;
        min-height: auto;
    }

    .cj-float-elements {
        display: none;
    }

    .cj-auth-form-panel {
        padding: 30px 25px;
    }

    .cj-form-row {
        flex-direction: column;
        gap: 0;
    }
}

@media (max-width: 768px) {
    .cj-profile-hero {
        flex-direction: column;
        text-align: center;
        padding: 25px 20px;
    }

    .cj-profile-hero-actions {
        margin-left: 0;
        margin-top: 10px;
    }

    .cj-edit-layout {
        flex-direction: column;
    }

    .cj-edit-sidebar {
        flex: none;
        margin-bottom: 15px;
    }

    .cj-edit-body {
        padding: 20px;
    }

    .cj-edit-header {
        padding: 18px 20px;
    }
}

/* Fix for search button getting blue background */
.header-right .btn-search,
.header-right a.btn.kotak.clean i.fa-search {
    background: transparent !important;
}

.header-right a.btn.kotak.clean {
    background: transparent !important;
}

/* ---------------------------------------------------------------
   6. NEWS MANAGEMENT & TABS
   --------------------------------------------------------------- */
.cj-nav-tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
}

.cj-nav-tab {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background: #fff;
    color: #444;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.cj-nav-tab:hover {
    background: #f8f9fa;
    color: #28a745;
}

.cj-nav-tab.active {
    background: #28a745;
    color: #fff;
    box-shadow: 0 8px 15px rgba(40, 167, 69, 0.2);
}

.cj-table-responsive {
    overflow-x: auto;
}

.cj-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.cj-table th {
    text-align: left;
    padding: 15px;
    background: #f8f9fa;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    border-bottom: 2px solid #eee;
}

.cj-table td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    color: #444;
}

.cj-table tr:hover td {
    background: #fcfcfc;
}

.badge {
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success { background: #d4edda; color: #155724; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-info { background: #d1ecf1; color: #0c5460; }

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-info {
    background: #17a2b8;
    color: #fff;
}

.btn-danger {
    background: #dc3545;
    color: #fff;
}
