/* ============================================
   Profile + Notifications Styles - روال
   ============================================ */

.profile-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 8px 12px 40px;
}

.profile-header-card {
    background: white;
    border-radius: 28px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    padding: 36px 28px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.profile-header-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 110px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

.profile-header-card .back-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.25);
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.profile-header-card .back-btn:hover {
    background: rgba(255,255,255,0.4);
}

.profile-avatar-wrap {
    position: relative;
    display: inline-block;
    margin-top: 40px;
    z-index: 1;
}

.profile-avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    border: 5px solid white;
    object-fit: cover;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.online-indicator {
    position: absolute;
    bottom: 8px;
    left: 8px;
    width: 18px;
    height: 18px;
    background: #10b981;
    border: 3px solid white;
    border-radius: 50%;
}

.profile-name {
    font-size: 1.7rem;
    font-weight: 800;
    margin: 16px 0 4px;
    color: var(--text);
}

.profile-role {
    font-size: 0.95rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 14px;
}

.profile-bio {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.7;
    max-width: 420px;
    margin: 0 auto 24px;
}

.profile-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.profile-stats .stat-item {
    text-align: center;
}

.profile-stats .stat-num {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
}

.profile-stats .stat-label {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 600;
}

.profile-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.profile-actions .btn {
    padding: 11px 24px;
    font-size: 0.92rem;
}

/* ========== My Profile Edit ========== */
.my-profile-card {
    background: white;
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    padding: 32px 28px;
}

.avatar-edit-section {
    text-align: center;
    margin-bottom: 32px;
}

.avatar-preview-wrap {
    position: relative;
    display: inline-block;
}

.avatar-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid #e0e7ff;
    object-fit: cover;
    box-shadow: var(--shadow);
}

.change-avatar-btn {
    position: absolute;
    bottom: 4px;
    left: 4px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: 3px solid white;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.avatar-hint {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 10px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 28px 0 20px;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 18px;
    color: var(--text);
}

.my-profile-card .form-section {
    margin-bottom: 18px;
}

.my-profile-card label {
    display: block;
    font-size: 0.92rem;
    font-weight: 700;
    margin-bottom: 7px;
    color: var(--text);
}

.my-profile-card input,
.my-profile-card textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.95rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-family: 'Vazirmatn', sans-serif;
    transition: all 0.25s;
}

.my-profile-card input:focus,
.my-profile-card textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    outline: none;
}

/* ========== Notifications ========== */
.notifications-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 8px 12px 40px;
}

.notif-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: white;
    padding: 8px;
    border-radius: 9999px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.notif-filter {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-light);
    cursor: pointer;
    font-family: 'Vazirmatn', sans-serif;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.notif-filter.active {
    background: var(--primary);
    color: white;
}

.filter-badge {
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 9999px;
    font-weight: 700;
}

.notif-filter.active .filter-badge {
    background: white;
    color: #ef4444;
}

.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notif-item {
    display: flex;
    gap: 14px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    transition: all 0.2s;
    cursor: pointer;
}

.notif-item:hover {
    border-color: #c7d2fe;
    box-shadow: var(--shadow);
}

.notif-item.unread {
    background: linear-gradient(135deg, #f0f4ff 0%, #ffffff 100%);
    border-color: #c7d2fe;
}

.notif-item .notif-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #e0e7ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.notif-item.unread .notif-icon {
    background: var(--primary);
}

.notif-body {
    flex: 1;
    min-width: 0;
}

.notif-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 3px;
    color: var(--text);
}

.notif-text {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.5;
}

.notif-time {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 6px;
}

.notif-dot {
    width: 10px;
    height: 10px;
    background: #ef4444;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 6px;
}

/* ========== Notification Dropdown (Header) - نسخه اصلاح‌شده ========== */

/* جلوگیری از چرخش دراپ‌داون با دکمه */
.notification-btn {
    transform: none !important;
}
.notification-btn:hover {
    transform: none !important;
    background: var(--light-bg);
}
/* فقط خود آیکون بچرخه، نه کل دکمه */
.notification-btn:hover > span:first-child,
.notification-btn:hover {
    /* آیکون داخل دکمه می‌تونه بچرخه اما خود دکمه نه */
}

.notif-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(4px);
    z-index: 5000;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.notif-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

.notif-dropdown {
    position: fixed;
    z-index: 5100;
    background: white;
    border: 1px solid #e2e8f0;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0,0,0,0.03);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(-12px) scale(0.96);
    transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.notif-dropdown.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* موبایل: bottom sheet */
@media (max-width: 639px) {
    .notif-dropdown {
        transform: translateY(100%);
    }
    .notif-dropdown.show {
        transform: translateY(0);
    }
}

.notif-dropdown-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    flex-shrink: 0;
}

.notif-dropdown-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 1.05rem;
    color: #1e2937;
}

.notif-bell-icon {
    font-size: 1.15rem;
}

.notif-unread-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6366f1;
    background: #e0e7ff;
    padding: 3px 10px;
    border-radius: 9999px;
}

.notif-dropdown-list {
    flex: 1;
    overflow-y: auto;
    max-height: 320px;
    -webkit-overflow-scrolling: touch;
}

.notif-dropdown-item {
    display: flex;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid #f8fafc;
    cursor: pointer;
    transition: background 0.15s;
    align-items: flex-start;
}

.notif-dropdown-item:last-child {
    border-bottom: none;
}

.notif-dropdown-item:hover {
    background: #f0f4ff;
}

.notif-dropdown-item:active {
    background: #e0e7ff;
}

.notif-dropdown-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.notif-dropdown-body {
    flex: 1;
    min-width: 0;
}

.notif-dropdown-item-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: #1e2937;
    margin-bottom: 3px;
    line-height: 1.35;
}

.notif-dropdown-item-text {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notif-dropdown-item-time {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-top: 5px;
}

.notif-dropdown-dot {
    width: 9px;
    height: 9px;
    background: #ef4444;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 6px;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.notif-dropdown-footer {
    padding: 12px 16px;
    text-align: center;
    border-top: 1px solid #f1f5f9;
    background: #fafbfc;
    flex-shrink: 0;
}

.notif-view-all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #6366f1;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 12px;
    transition: all 0.2s;
    width: 100%;
}

.notif-view-all:hover {
    background: #e0e7ff;
    color: #4f46e5;
}

.notif-empty {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
}

.notif-empty-icon {
    font-size: 2.4rem;
    margin-bottom: 10px;
}

.notif-empty p {
    font-size: 0.95rem;
    margin: 0;
}

.empty-notifs {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

@media (max-width: 480px) {
    .profile-header-card {
        padding: 28px 18px;
    }
    .profile-avatar {
        width: 90px;
        height: 90px;
    }
    .profile-stats {
        gap: 20px;
    }
    .my-profile-card {
        padding: 24px 16px;
    }

    .notif-dropdown-list {
        max-height: 50vh;
    }
}


@keyframes notifPulse {
    0% { transform: scale(1); }
    40% { transform: scale(1.15); }
    100% { transform: scale(1); }
}
.notification-btn.notif-pulse {
    animation: notifPulse 0.5s ease 2;
}


/* Profile form extras */
.input-readonly {
    background: #f1f5f9 !important;
    color: #64748b !important;
    cursor: not-allowed;
}
.field-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.78rem;
    color: #94a3b8;
}
.profile-divider {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 28px 0 20px;
}
.section-sub-title {
    font-size: 1.1rem;
    font-weight: 800;
    margin: 0 0 16px;
    color: #0f172a;
}
.profile-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-top: 8px;
    font-size: 0.85rem;
    color: #64748b;
}
.profile-meta-row span {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 4px 12px;
}

/* Password strength */
.password-strength {
    margin-top: 10px;
}
.strength-bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}
.strength-fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    transition: width 0.25s, background 0.25s;
    background: #ef4444;
}
.strength-label {
    font-size: 0.8rem;
    margin-top: 6px;
    font-weight: 600;
    color: #64748b;
}
.strength-rules {
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
    font-size: 0.78rem;
    color: #94a3b8;
}
.strength-rules li {
    margin-bottom: 4px;
    padding-right: 4px;
}
.strength-rules li.ok {
    color: #059669;
    font-weight: 600;
}
.strength-rules li.ok::before {
    content: "✓ ";
}
.strength-rules li.bad {
    color: #dc2626;
}
.strength-rules li.bad::before {
    content: "✕ ";
}


.profile-status-line {
    margin: 6px 0 14px;
    font-size: 0.88rem;
}
.status-online { color: #059669; font-weight: 700; }
.status-offline { color: #94a3b8; }

.profile-shared-card {
    max-width: 560px;
    margin: 20px auto 40px;
    background: #fff;
    border-radius: 20px;
    padding: 20px 22px;
    border: 1px solid var(--border, #e2e8f0);
    box-shadow: var(--shadow, 0 4px 20px rgba(0,0,0,.04));
}
.profile-shared-card h3 {
    margin: 0 0 14px;
    font-size: 1.05rem;
    font-weight: 800;
}
.shared-project-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 8px;
    border-bottom: 1px solid #f1f5f9;
    text-decoration: none;
    color: inherit;
}
.shared-project-item:last-child { border-bottom: none; }
.shared-project-item:hover { background: #f8fafc; border-radius: 10px; }
.shared-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.shared-name { flex: 1; font-weight: 700; font-size: 0.92rem; }
.shared-progress { font-size: 0.85rem; color: #64748b; font-weight: 600; }

.profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 18px;
}
.profile-actions .btn {
    min-width: 140px;
}
